Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: more precommit hooks #1325

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jjmaestro
Copy link
Contributor

@jjmaestro jjmaestro commented Nov 19, 2024

Here's a bit of a winter house cleaning :)

Add a bunch of pre-commit hooks:

  • Some basic hooks to prevent usual whitespace nits (mixed line endings, trailing whitespace and missing EOF) and merge conflicts
  • Lint YAML (actions) and validate GH Actions (two validators because they are both quite useful for different reasons!)
  • Also validate shell scripts and Makefiles (NOTE: one of the GH Action validators also shellchecks the scripts in them :)
  • Finally, skip checks on generated files (diff/patches and testing expected outputs).

Then, run pre-commit run --all-files to lint and fix the things that can be automatically fixed.

Finally, a few more commits to fix the stuff that can't be fixed manually:

  • some outdated GH Actions + shellcheck parts of the GH actions
  • check Makefiles
  • shellcheck scripts and exclude examples/ because there's quite a bunch of warnings so it's probably better to leave those for another PR.

* Some basic hooks to prevent usual whitespace nits (mixed line endings,
  trailing whitespace and missing EOF) and merge conflicts

* Lint YAML (actions) and validate GH Actions (two validators because
  they are both quite useful for different reasons!)

* Also validate shell scripts and Makefiles (NOTE: one of the GH Action
  validators also shellchecks the scripts in them :)

* Finally, skip checks on generated files (diff/patches and testing
  expected outputs).
Automatic linting of all the files. Also, commit with --no-verify
because there's still a bunch of things that require manual fixing.
@jjmaestro
Copy link
Contributor Author

Ah, forgot to double-check tests locally :S The .pre-commit hooks modified some expected test output. I'll exclude those files as well.

There's a lot of stuff reported so excluding it from the time being,
will probably create a separate PR just for this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant