-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CI,STYLE: narrow down ignore-words-list of codespell #38847
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
Conversation
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.
Looks good to me, thanks @chinggg !
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.
I am personally -1 on using the codespellignorelines
like this. IMO that will become too complex. A code check is nice, but should not become too convoluted or get in the way (eg now if someone changes one of those lines slightly, you get linting errors and need to update codespellignorelines
as well)
.codespellignorelines
Outdated
@@ -0,0 +1,7 @@ | |||
1 fo | |||
end_types = {"M", "A", "Q", "BM", "BA", "BQ", "W"} |
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.
The strings on this line are simply valid arguments in pandas for frequencies. So they can also appear elsewhere, IMO just ignoring this line is too brittle, and I would personally leave this as a global ignored word.
That's a good point, thanks @jorisvandenbossche So, do you suggest to keep this PR's renaming of |
@MarcoGorelli I agree with @jorisvandenbossche to remove the |
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.
Thanks @chinggg for updating! It's showing 101 files changed though, something may have gone wrong while merging - could you try again please?
@MarcoGorelli I fetch from |
@chinggg it's fine to fetch before adding new commits, but that shouldn't show so many changed files - without seeing the exact commands you ran, it's hard to guess what may have gone wrong I think now I'd suggest
, when trying that locally from your branch it works fine |
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.
This looks better, thanks @chinggg !
@jorisvandenbossche further comments?
setup.cfg
Outdated
@@ -64,7 +64,7 @@ filterwarnings = | |||
junit_family=xunit2 | |||
|
|||
[codespell] | |||
ignore-words-list=ba,blocs,coo,datas,fo,hist,nd,ser | |||
ignore-words-list=ba,blocs,coo,fo,hist,nd,ser |
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 it possible to just ignore pandas/core/strings/accessor.py instead / in-addition to?
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.
as in, ignore the whole file? Yes, that's easily done with
exclude: ^pandas/core/strings/accessor\.py$
in .pre-commit-config.yaml
, it's just not clear to me why that would be preferrable
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.
to avoid the fragility of 'fo'
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.
@jreback an alternative would be to change the example to use 'nox'
instead of 'fox'
- which isn't a real animal, but at least then no
is a real word and we avoid having to ignore an entire file, does that seem OK?
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.
i would rather just ignore that example if we can. it IS pretty fragile. its not likely to change much in the future though, so i suppose if you can't ignore that line then just changing the example is prob ok.
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.
OK if we use dog
then there's no failures and we can use a real animal 🎉
The original PR changed the example actually, before I asked them to change (sorry @chinggg !) so I've added a commit for them - look good now?
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.
Yeah! Thanks @MarcoGorelli , it looks good to me.
thanks @chinggg |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
see Issue CI/STYLE extend codespell beyond pandas/core #38802, task4