-
Notifications
You must be signed in to change notification settings - Fork 94
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
Update pre-commit, remove vale #1282
Conversation
I intentionally committed with Have a look at the GHA logs for |
Amazing work @iameskild, just finished looking through the changes, and still need to know the end result of the action. But I liked this organization!!! One thing that I suggest is to add the following |
Also, not sure about what the others think of this but we could add a message to the PR automatically in case the pre-commit action fails, explaining to the user (if it's a new user) about pre-commit and how to install it, something like this: ...
steps:
- uses: mshick/add-pr-comment@v1
with:
message: |
First of all, thank you for taking the time to contribute! :tada:
It seems that some tests are falling, please refer to the pre-commit logs for more details or check if pre-commit is
correctly installed. If you're a first-time contributor, you can follow this steps to automatically set up pre-commit and
avoid these errors.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: false # This will avoid duplicating comments We can add a link to some step-by-step installation from pre-commit itself, or add extra information in the comment. |
I like this! |
@iameskild once you get a preview of these changes let us know. The PR LGTM!! |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@viniciusdc @HarshCasper @costrouc this PR is ready to be merged whenever you feel ready :) |
I need to understand why the Kubernetes tests are failing before merging... |
@iameskild @HarshCasper the pre-commit job seems to be failing now, would you mind having a look? Also, how this will work again? I thought the pre-commit stuff would be executed by the user only... |
@viniciusdc some of the recent PRs had "unformatted" files which caused the pre-commit CI to fail. At this point, we will need to pull down the changes, make pre-commit happy and push those changes up. Is this workflow too complex? I will need to investigate why the jupyterlab image failed to build though. |
Think of this PR as more of a discussion.
Theme (or goals)
pre-commit
) for quicker feedback that is NOT reliant on CI.Description and motivations for these changes:
codespell
pre-commit hook.codespell
, the benefits of usingcodespell
over Vale include:codespell
has a very low false positive rate and only makes suggestions/fixes for common words, skipping technical terms. This means we don't have to continuously maintain a dictionary like we do for Vale.codespell
can make the fixes automatically (usingpre-commit
, withcodespell --write
enabled).codespell
can run in files besides just.md
, seesetup.cfc::codespell
for files currently excluded.vale
from the command line seems like it adds a lot friction for new contributors.pre-commit
.codespell
pre-commit hook, as mentioned above.terraform_fmt
pre-commit hook to format Terraform files according the Terraform style guidelines.isort
pre-commit hook to cleanly sort python imports.check-json
pre-commit hook to check json files ;)pyproject.toml
,setup.cfg
or within the.pre-commit-config.yaml
itself. Files as such.hadolint.yaml
and.mdformat.toml
can subsequently be removed.docs.yaml
(Documentation Linter) Github Action workflow.link-checker
for the time being, then we can completely remove this workflow.link-checker
to be exceptionally flaky. It feels like it reports false positives on every other one of my doc related PRs. As a result, I've spent more time than I'd like running down upstream bugs, making minor changes to thelink-checker
GHA or simply ignoring the failed CI.run-pre-commit.yaml
which hands all linting and formatting.pre-commit run --all-files
to ensure all of our files are always properly linted / formatted. Triggered for every PR and for every push tomain
.These proposed changes are ultimately the result of the frustration I've felt while writing or updating docs, consistently getting errors from Vale or the link-checker or both. Like I mentioned above, I think Vale is definitely a more comprehensive spell checker (and style checker) but the added benefits don't outweigh the friction it causes the development workflow especially compared to a baseline using
codespell
.If accepted, we can close #1007 #972.
I would love to hear others have to say about this propose change :)
cc. @costrouc @tonyfast @magsol @viniciusdc @HarshCasper @aktech @kcpevey @trallard