You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codespell blocking documentation commit on attribute name #3888
I have an attribute .aks in code that I'm documenting, but codespell blocks the commit in the tutorial because it thinks I mean 'ask'.
There doesn't seem to be any in-file codespell directive to ignore the lines, is there some other suggested workaround?
Here's a PR to address this issue, it's a pretty easy fix. Any maintainers, please let me know if this requires a different approach. (will keep an eye on the build to see if anything else needs tweaking)
Thanks, but I don’t understand from the PR (admittedly trying to navigate from my phone) what it does or how I use it. I’m trying to commit Tutorial.tex with doctest code causing the problem.
Thanks, but I don’t understand from the PR (admittedly trying to navigate from my phone) what it does or how I use it. I’m trying to commit Tutorial.tex with doctest code causing the problem.
The PR adds .aks to the things codespell ignores as a spelling mistake. So, if my PR is approved and merged, then codespell won't block your commit anymore (assuming you rebase when/if my PR is merged).
Alternatively, you can just copy the change I made in my PR into your own to stop codespell from blocking your commit.
To make it super easy on you, download this file: diff.txt
and then from within your repository run git apply path/to/diff.txt and then commit. That should take stop codespell from blocking you.
From reading the diff (sorry away from computer until Tuesday) it looks like this excludes files with a .aks extension? Sorry if I’m misunderstanding, but seems like the change should go in the next line, to ignore ‘aks’ because it’s not a mis-spelling of ‘ask’…. In three lines of one file of the entire project.
Obviously I can add this exception, but it just seems like a bad approach and non-obvious to developers going forward. Codespell has a feature request for in-line ignores outstanding since 2019, and just doesn’t feel like the right tool to use at this time without it. @peterjc view?
Thank you @erik-whiting for showing me where to make the fixes. There also seems to be an option to specify a file of lines to ignore but have not worked out the details. See discussion at codespell 1212
See #3709, "This is configured to check *.rst, *.md and *.tex files only (hard to do directly with codespell, easy in pre-commit), uses a regex to ignore 2 and 3 letter upper case acronyms, and ignores a handful of words."
(I've not seen the code, but is .aks really the best name for this attribute?)
Yes, I was able to add 'aks' to .pre-commit-config.yaml and commit. Reflecting on your other comment (and my own comments in the code about what '.aks' refers to :-)), I have refactored to make the name more meaningful.
Activity
erik-whiting commentedon Mar 25, 2022
Here's a PR to address this issue, it's a pretty easy fix. Any maintainers, please let me know if this requires a different approach. (will keep an eye on the build to see if anything else needs tweaking)
rob-miller commentedon Mar 26, 2022
Thanks, but I don’t understand from the PR (admittedly trying to navigate from my phone) what it does or how I use it. I’m trying to commit Tutorial.tex with doctest code causing the problem.
erik-whiting commentedon Mar 26, 2022
The PR adds
.aksto the things codespell ignores as a spelling mistake. So, if my PR is approved and merged, then codespell won't block your commit anymore (assuming you rebase when/if my PR is merged).Alternatively, you can just copy the change I made in my PR into your own to stop codespell from blocking your commit.
To make it super easy on you, download this file:
diff.txt
and then from within your repository run
git apply path/to/diff.txtand then commit. That should take stop codespell from blocking you.rob-miller commentedon Mar 26, 2022
From reading the diff (sorry away from computer until Tuesday) it looks like this excludes files with a .aks extension? Sorry if I’m misunderstanding, but seems like the change should go in the next line, to ignore ‘aks’ because it’s not a mis-spelling of ‘ask’…. In three lines of one file of the entire project.
Obviously I can add this exception, but it just seems like a bad approach and non-obvious to developers going forward. Codespell has a feature request for in-line ignores outstanding since 2019, and just doesn’t feel like the right tool to use at this time without it. @peterjc view?
rob-miller commentedon Mar 26, 2022
Thank you @erik-whiting for showing me where to make the fixes. There also seems to be an option to specify a file of lines to ignore but have not worked out the details. See discussion at codespell 1212
peterjc commentedon Mar 31, 2022
You can add special words to the
-Largument for codespell here: https://github.com/biopython/biopython/blob/master/.pre-commit-config.yamli.e. It would be in addition to ser (for amino acid serine) etc:
See #3709, "This is configured to check *.rst, *.md and *.tex files only (hard to do directly with codespell, easy in pre-commit), uses a regex to ignore 2 and 3 letter upper case acronyms, and ignores a handful of words."
(I've not seen the code, but is
.aksreally the best name for this attribute?)rob-miller commentedon Apr 1, 2022
Yes, I was able to add 'aks' to .pre-commit-config.yaml and commit. Reflecting on your other comment (and my own comments in the code about what '.aks' refers to :-)), I have refactored to make the name more meaningful.