Skip to content

dx: extend pre-commit hook to check all workspaces #37

@snowrugar-beep

Description

@snowrugar-beep

Problem Statement

The pre-commit hook (.husky/pre-commit) only runs lint-staged in the Backend directory. It does not run linting or type-checking for Frontend, Analytics, or Contracts (Rust). Issues in these workspaces are only caught in CI.

Evidence

  • .husky/pre-commit line 1: cd Backend && npx lint-staged
  • No Frontend, Analytics, or Contract checks

Impact

CI fails on Frontend/Analytics/Contracts errors that could be caught locally. Slower feedback loop.

Proposed Solution

Extend pre-commit to:

  1. Run cd Frontend && npx lint-staged
  2. Run cd analytics && npx lint-staged
  3. Run cd contracts && cargo check (only on changed .rs files)

Technical Requirements

  • Must still run all checks even if one fails (report all errors)
  • Must not slow down commits excessively (< 10 seconds)
  • Must skip checks if no relevant files changed

Acceptance Criteria

  1. Changing a Frontend file triggers Frontend lint-staged
  2. Changing an Analytics file triggers Analytics lint-staged
  3. Changing a Rust file triggers cargo check
  4. All checks running in parallel
  5. Failure in one workspace does not skip other checks

File Inventory

  • .husky/pre-commit

Dependencies

None.

Testing Strategy

  • Modify file in each workspace and verify pre-commit triggers

Security Considerations

Faster local validation reduces chance of vulnerable code reaching CI.

Definition of Done

  • Pre-commit checks all workspaces
  • Parallel execution
  • All errors reported

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaigndxlow

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions