Skip to content

CLN: Enable codespell for all files #51804

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

Conversation

luke396
Copy link
Contributor

@luke396 luke396 commented Mar 6, 2023

It seems works fine in current main branch.

@MarcoGorelli
Copy link
Member

thanks

doesn't look like it

 codespell...............................................................................................Failed
- hook id: codespell
- duration: 1.66s
- exit code: 65

pandas/tests/io/data/xml/cta_rail_lines.kml:14: fo ==> of, for, to, do, go
pandas/tests/io/data/xml/cta_rail_lines.kml:14: DESCRIPTIO ==> DESCRIPTION
pandas/tests/io/data/xml/cta_rail_lines.kml:27: fo ==> of, for, to, do, go
pandas/tests/io/data/xml/cta_rail_lines.kml:27: DESCRIPTIO ==> DESCRIPTION
pandas/tests/io/data/xml/cta_rail_lines.kml:40: fo ==> of, for, to, do, go
pandas/tests/io/data/xml/cta_rail_lines.kml:40: DESCRIPTIO ==> DESCRIPTION
pandas/tests/io/data/xml/cta_rail_lines.kml:53: fo ==> of, for, to, do, go
pandas/tests/io/data/xml/cta_rail_lines.kml:53: DESCRIPTIO ==> DESCRIPTION
pandas/tests/io/data/xml/cta_rail_lines.kml:66: fo ==> of, for, to, do, go
pandas/tests/io/data/xml/cta_rail_lines.kml:66: DESCRIPTIO ==> DESCRIPTION
pandas/_libs/src/ujson/lib/ultrajson.h:190: iteratable ==> iterable
pandas/_libs/src/ujson/lib/ultrajson.h:202: iteratable ==> iterable
pandas/_libs/testing.pyx:190: ambigous ==> ambiguous
pandas/_libs/src/parser/tokenizer.c:1831: housand ==> thousand
pandas/_libs/ops_dispatch.pyx:94: nin ==> inn, min, bin, nine
pandas/_libs/missing.pyx:55: ambigous ==> ambiguous
pandas/_libs/tslibs/strptime.pyx:3: TimeRE ==> timer
pandas/_libs/tslibs/strptime.pyx:11: TimeRE ==> timer
pandas/_libs/tslibs/strptime.pyx:28: TimeRE ==> timer
pandas/_libs/tslibs/strptime.pyx:236: TimeRE ==> timer
pandas/_libs/tslibs/strptime.pyx:536: TimeRE ==> timer
pandas/_libs/tslibs/strptime.pyx:552: TimeRE ==> timer
pandas/_libs/tslibs/strptime.pyx:562: TimeRE ==> timer
pandas/_libs/tslibs/strptime.pyx:571: TimeRE ==> timer
pandas/_libs/hashing.pyx:58: datas ==> data
pandas/_libs/hashing.pyx:100: datas ==> data
web/pandas/config.yml:161: dfine ==> define
WARNING: Decoding file using encoding=utf-8 failed: pandas/tests/io/data/xml/baby_names.xml
WARNING: Trying next encoding iso-8859-1
pandas/_libs/lib.pyx:2653: becase ==> because
pandas/_libs/tslibs/timestamps.pyx:2347: overriden ==> overridden
pandas/_libs/tslibs/timestamps.pyx:2357: overriden ==> overridden
pyproject.toml:276: indendation ==> indentation
pandas/_libs/tslibs/timedeltas.pyx:1109: overrided ==> overrode, overridden

how did you run it locally? it should be pre-commit run codespell --all-files

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Mar 6, 2023
Comment on lines 45 to 51
types_or: [python, rst, markdown]
exclude: |
(?x)
pandas/tests/io/data/xml
|pandas/_libs/ops_dispatch.pyx
|pandas/_libs/tslibs/strptime
|web/pandas/config.yml

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about expanding types_or instead of excluding certain files? cython and c should probably be in there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for so fast replay!

We should add cython and c, instead of exclude some files?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This time?

@luke396
Copy link
Contributor Author

luke396 commented Mar 6, 2023

I forgot to run it with --all-files before.

I make some changes, but some of them may not suitable. I am open to any suggestions or advice.

types_or: [python, rst, markdown, cython, c]
exclude: |
(?x)
|pandas/_libs/ops_dispatch.pyx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these excluded?

Copy link
Contributor Author

@luke396 luke396 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

image

nin cause error, same as TimeRE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I add some comment to explain them?

Copy link
Member

@MarcoGorelli MarcoGorelli Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - probably fine to add both to the ignores in

[tool.codespell]

then

@luke396 luke396 requested a review from MarcoGorelli March 6, 2023 13:16
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @luke396 !

@MarcoGorelli MarcoGorelli added this to the 2.1 milestone Mar 6, 2023
@MarcoGorelli MarcoGorelli merged commit 75c1b96 into pandas-dev:main Mar 6, 2023
@luke396 luke396 deleted the enable-codespell-for-all-files branch March 6, 2023 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH:Possible expansion of codespell to more file types
3 participants