pepr icon indicating copy to clipboard operation
pepr copied to clipboard

Improve developer experience by automatically linting commits

Open samayer12 opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

Contributors are directed to run npm run format:fix before committing to ensure code standards are met. This is fine, but we could completely automate that step by using a tool like Husky to enforce an automatic "lint on commit" that works out of the box without additional developer setup.

Describe the solution you'd like

  • Given husky & a pre-commit hook are configured
  • When a developer runs git commit
  • Then the linter is ran on changed files only

Describe alternatives you've considered

We could let contributors remember to run npm run format:fix, which will be caught by CI.

We could use some other git hook management tool, or provide more manual instructions to setup that workflow automation.

Additional context

Husky docs.

Implementation guide for using lint-staged as a pre-commit hook with Husky.

samayer12 avatar Aug 29 '24 20:08 samayer12

@samayer12 I would like to work on this

itsarijitray avatar Aug 30 '24 06:08 itsarijitray

Sounds good @itsarijitray , it is assigned to you. Let us know if you have any questions. Please also keep the command npm run format:fix since it is used in CI and other flows as well.

cmwylie19 avatar Aug 30 '24 11:08 cmwylie19

Sure. Thanks!!!

itsarijitray avatar Aug 30 '24 12:08 itsarijitray

PR: https://github.com/defenseunicorns/pepr/pull/1160

@cmwylie19 @samayer12

itsarijitray avatar Aug 31 '24 10:08 itsarijitray

fixed and merged thanks @itsarijitray

cmwylie19 avatar Nov 01 '24 12:11 cmwylie19