-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add codespell support (config, workflow to detect/not fix) and make it fix few typos #37
base: main
Are you sure you want to change the base?
Changes from 4 commits
fbfae69
b43149e
bfcf337
b82430f
ac144fd
95e0236
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Codespell configuration is within pyproject.toml | ||
--- | ||
name: Codespell | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
codespell: | ||
name: Check for spelling errors | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Annotate locations with typos | ||
uses: codespell-project/codespell-problem-matcher@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it annotates typos directly in the PR diff - quite handy |
||
- name: Codespell | ||
uses: codespell-project/actions-codespell@v2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,3 +75,10 @@ log_cli_level = "DEBUG" | |
[tool.mypy] | ||
no_strict_optional = true | ||
ignore_missing_imports = true | ||
|
||
[tool.codespell] | ||
# Ref: https://github.com/codespell-project/codespell#using-a-config-file | ||
skip = '.git*' | ||
check-hidden = true | ||
ignore-regex = '(^\s*"image/\S+": ".*|ND)' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are here to suppress false positives? We will see how long this gets 😅. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed |
||
# ignore-words-list = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a strong reason for this to be its own workflow rather than folded into
ci.yaml
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be done so if you like but
With that in mind I would have recommended to move "pre-commit" encoded checks into separate workflow, and leave/rename
ci
to run only tests but across different python versions (now just 3.8)You could also encode them all in a single CI workflow file, but then I would also recommend to centralize them actually outside, e.g. in
tox.ini
and then just sweep through different invocations. Eg. look at https://github.com/con/duct/blob/main/.github/workflows/test.yaml which sweeps through different pythons for testing but also adds runs for type checks and linting.so -- many ways to skin a cat here ;-)