-
Notifications
You must be signed in to change notification settings - Fork 9
Use hk to run linters #3412
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
Merged
Merged
Use hk to run linters #3412
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
misaka
reviewed
Apr 16, 2025
Worth noting, if we want the pre-commit hook enabled, I needed to run the install with
|
misaka
approved these changes
Apr 24, 2025
This installs the tools `hk` and `pkl` which can be used to manage Git hooks and run linters.
This configures `hk` to run the `rubocop` linter. To support this I've had to make a couple of changes to `.rubocop.yml` to exclude `db/schema.rb` when checking it individually.
This configures the `rufo` linter to run with `hk`.
This configures the `prettier` linter to run with `hk`.
This configures the Brakeman linter to run with `hk`.
This configures `terraform fmt` to run with `hk`.
This configures `tf_lint` to run with `hk`.
`hk` is a tool that runs linters so we can change our `bin/lint` script to call `hk`.
TheOneFromNorway
approved these changes
Apr 24, 2025
This configures the "Lint" workflow to use `hk` instead of calling the linters manually.
This moves a large block of content out of the `README.md` file and in to its own file dedicated only to the release process. This should help to keep the `README.md` file easier to read.
This moves a large block of content out of the `README.md` file and in to its own file dedicated only to the branching strategy. This should help to keep the `README.md` file easier to read.
To explain to new developers the linting tool we use, how to install it and how to use it.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates our linting set up to use
hk
as the tool runner for our various linters.hk
is a new tool that is designed to run commands as part of a Git commit, and through that it can be used to run linting tools. It's a proposed alternative topre-commit
with some specific goals around running linters in parallel and being highly performant.This is proposed as an alternative to #3001 to avoid the need to add Python to our project, specifically
hk
is provided as a binary and can be included in.tool-versions
installed by Mise. On the other hand, compared topre-commit
,hk
is a new project and not yet fully supported (there's a warning that things may change in each release on the project website), so we may choose to put this off until a time whenhk
becomes more mature.This comes with similar advantages to
pre-commit
, such as having a standard approach to configuring our linting tools, and for those who wish to, it allows you to integrate the linting withgit commit
.In this PR, I've converting our existing GitHub Actions workflow to a single linting workflow which calls
hk check
. This does mean we lose granularity of individual linters, and if we'd prefer to stick with our existing approach that can be done by usinghk check --linter <linter>
.