Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
fcbbc3c to
b2116a2
Compare
This comment has been minimized.
This comment has been minimized.
Run eslint and prettier only on staged files instead of the full project to keep commits fast. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b2116a2 to
c3eb007
Compare
This comment has been minimized.
This comment has been minimized.
| rev: v8.17.0 | ||
| hooks: | ||
| - id: gitleaks | ||
| - repo: local |
There was a problem hiding this comment.
Suggestion: Nice idea! did you intentionally not use npm run format?
There was a problem hiding this comment.
The only worry I have is performance/latency it adds.
There was a problem hiding this comment.
@PeterSchafer yeah I originally had npm run lint which I believe covers formatting and is also what we run in the code-analysis job. The issue with that is that it will run the linter/formatter on all the files every time.
This approach limits it only to what has changed before committing. Performance wise, we can't go any further I believe.
There was a problem hiding this comment.
Locally on my 32GB M1 the whole npm run lint runs in 7s - so that's the absolute worst case scenario.
There was a problem hiding this comment.
I think running the same commands as in the code-analysis step should suffice. i.e. npm run lint & make lint.
I agree that the ~15seconds it takes to run the pre-commit linting is better than waiting for the CI job to fail
There was a problem hiding this comment.
okay let's run an experiment. when it gets too long, we can still change it!
There was a problem hiding this comment.
@j-luong so would you prefer the full npm run lint command or this version? This version I believe covers everything though if you would change what npm run lint does it would fall through the cracks.
PR Reviewer Guide 🔍
|

Pull Request Submission Checklist
What does this PR do?
Adds a
lintpre-commit hook that runsnpm run lint(eslint + prettier) locally before each commit. This matches the linting step in the code-analysis CI job.Also updates
scripts/install-dev-dependencies.shto runpre-commit installso the hooks are automatically activated for new and existing developers.Why?
Linting issues that only surface in the
code-analysisCI job increase the feedback loop — developers push, wait for CI, discover a formatting error, fix, push again. Running the same checks locally as a pre-commit hook catches these issues immediately, before the code even leaves the machine.Where should the reviewer start?
.pre-commit-config.yaml— the newlinthookscripts/install-dev-dependencies.sh— addedpre-commit installHow should this be manually tested?
pre-commit install(or./scripts/install-dev-dependencies.sh).tsfile)git commit— should fail with prettier errorWhat's the product update that needs to be communicated to CLI users?
N/A — internal developer tooling only.