cucumber / language-server

Cucumber Language Server
MIT License
33 stars 19 forks source link

Migrate git hook dependency for linting staged changes #93

Closed kieran-ryan closed 7 months ago

kieran-ryan commented 7 months ago

🤔 What's changed?

For the purposes of listing staged files

⚡️ What's your motivation?

Fixes #92 - with the pre-commit hook failing to run; this allows unformatted commits to enter version control.

Unlike pretty-quick, lint-staged is preconfigured to run on staged changes but the default; thus we do not have to add it to our scripts, as it can simply run as npx lint-staged.

🏷️ What kind of change is this?

♻️ Anything particular you want feedback on?

Any defaults of pretty-quick behaviour that are not covered by lint-staged.

To test, modify files in the src and test directories and run:

git add src test
npx lint-staged

You should observe an output similar to the following:

✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...

📋 Checklist:

kieran-ryan commented 7 months ago

Thanks again for raising @binhtran432k - would be great if you could give this try, see whether it resolves your issue, and whether there any changes or considerations required. Cheers!