-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[pre-commit] Add codespell, and fix some existing typos #9912
Changes from all commits
c9b9fb3
74681ea
15139d3
e6668e8
9edacec
9b10dcf
9292f83
0e5f5ac
d99060f
649b33c
58a3dfb
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 |
---|---|---|
|
@@ -13,10 +13,11 @@ argumentparser | |
argumentsparser | ||
argv | ||
ascii | ||
asend | ||
assignattr | ||
assignname | ||
ast | ||
AST | ||
ast | ||
astroid | ||
async | ||
asynccontextmanager | ||
|
@@ -67,8 +68,8 @@ contextlib | |
contextmanager | ||
contravariance | ||
contravariant | ||
cpython | ||
CPython | ||
cpython | ||
csv | ||
CVE | ||
cwd | ||
|
@@ -126,8 +127,8 @@ formfeed | |
fromlineno | ||
fullname | ||
func | ||
functiΓΈn | ||
functiondef | ||
functiΓΈn | ||
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. What? haha 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. Yeah should probably remove that instead of sorting it alphabetically π . 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's used extensively in the unittest for non ascii name |
||
functools | ||
genexpr | ||
getattr | ||
|
@@ -160,10 +161,11 @@ isfile | |
isinstance | ||
isort | ||
iter | ||
itered | ||
iterable | ||
iterables | ||
itered | ||
iteritems | ||
iTerm | ||
jn | ||
jpg | ||
json | ||
|
@@ -206,10 +208,10 @@ monkeypatch | |
mro | ||
# Used so much that we need the abbreviation | ||
msg | ||
msg-template | ||
msgid | ||
msgids | ||
msgs | ||
msg-template | ||
mult | ||
multiline | ||
multiset | ||
|
@@ -250,8 +252,8 @@ parens | |
passthru | ||
pathlib | ||
patternerror | ||
positionals | ||
png | ||
positionals | ||
pragma | ||
pragma's | ||
pragmas | ||
|
@@ -264,9 +266,9 @@ pyenchant | |
pyfile | ||
pyi | ||
pylint | ||
pylint's | ||
pylintdict | ||
pylintrc | ||
pylint's | ||
pyproject | ||
pypy | ||
pyreverse | ||
|
@@ -275,6 +277,7 @@ qname | |
rawcheckers | ||
rc | ||
rcfile | ||
re-usable | ||
readlines | ||
recognise | ||
recurse | ||
|
@@ -345,9 +348,9 @@ tomlkit | |
toplevel | ||
towncrier | ||
tp | ||
truthey | ||
truthness | ||
truthy | ||
truthey | ||
tryexcept | ||
txt | ||
typecheck | ||
|
@@ -362,8 +365,8 @@ unary | |
unflattens | ||
unhandled | ||
unicode | ||
Uninferable | ||
uninferable | ||
Uninferable | ||
unittest | ||
unraisablehook | ||
untriggered | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,3 +200,32 @@ ignore = [ | |
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "pep257" | ||
|
||
[tool.codespell] | ||
ignore-words = ["custom_dict.txt"] | ||
|
||
# Disabled the spelling files for obvious reason, but also, | ||
# the test file with typing extension imported as 'te' and: | ||
# tests/functional/i/implicit/implicit_str_concat_latin1.py: | ||
# - bad encoding | ||
# pylint/pyreverse/diagrams.py and tests/pyreverse/test_diagrams.py: | ||
# - An API from pyreverse use 'classe', and would need to be deprecated | ||
# pylint/checkers/imports.py: | ||
# - 'THIRDPARTY' is a value from isort that would need to be handled even | ||
# if isort fix the typo in newer versions | ||
# tests/functional/m/member/member_checks.py: | ||
# - typos are voluntary to create credible 'no-member' | ||
|
||
skip = """ | ||
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. There is no way to do inline ignores? 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. Not in codespell (make sense as it's used in documentation mainly) |
||
tests/checkers/unittest_spelling.py,\ | ||
CODE_OF_CONDUCT.md,\ | ||
CONTRIBUTORS.txt,\ | ||
pylint/checkers/imports.py,\ | ||
pylint/pyreverse/diagrams.py,\ | ||
tests/pyreverse/test_diagrams.py,\ | ||
tests/functional/i/implicit/implicit_str_concat_latin1.py,\ | ||
tests/functional/m/member/member_checks.py,\ | ||
tests/functional/t/type/typevar_naming_style_rgx.py,\ | ||
tests/functional/t/type/typevar_naming_style_default.py,\ | ||
tests/functional/m/member/member_checks_async.py,\ | ||
""" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# pylint: disable=missing-module-docstring | ||
|
||
dictionary = {'0': 0} | ||
# quotes are inconsistent when targetting Python 3.12 (use single quotes) | ||
# quotes are inconsistent when targeting Python 3.12 (use single quotes) | ||
F_STRING = f'{dictionary["0"]}' # [inconsistent-quotes] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# pylint: disable=missing-module-docstring | ||
|
||
dictionary = {'0': 0} | ||
# quotes are consistent when targetting 3.11 and earlier (cannot use single quotes here) | ||
# quotes are consistent when targeting 3.11 and earlier (cannot use single quotes here) | ||
F_STRING = f'{dictionary["0"]}' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
undefined-all-variable:16:4:16:6::Undefined variable name '' in __all__:UNDEFINED | ||
undefined-variable:18:4:18:17::Undefined variable 'SomeUndefined':UNDEFINED | ||
undefined-all-variable:19:4:19:17::Undefined variable name 'NonExistant' in __all__:UNDEFINED | ||
undefined-all-variable:19:4:19:17::Undefined variable name 'NonExistent' in __all__:UNDEFINED | ||
undefined-all-variable:21:4:21:10::Undefined variable name 'func' in __all__:UNDEFINED | ||
undefined-all-variable:22:4:22:11::Undefined variable name 'inner' in __all__:UNDEFINED | ||
undefined-all-variable:23:4:23:16::Undefined variable name 'InnerKlass' in __all__:UNDEFINED |
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.
Should we just not add it then?
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.
It's still useful to sort it and then
git add -p
the changes.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 but I don't think we should be committing code that is commented out to
main
right?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.
It prevents us from having to recreate the sorting from zero every time we want to sort the file, Is there any downside apart from the file being a little longer ?
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.
Hmm I think it looks a bit sloppy to have code that you don't intend to use, but I guess it is fine?