-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add typos check to pre-commit hooks #10040
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cdf30e8
Add typos check to pre-commit hooks
max-sixty 0548b95
1cb7d9c
Merge branch 'main' into typos
max-sixty df9381b
d7630d3
6420625
Merge branch 'main' into typos
dcherian 6186bac
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
[project] | ||
authors = [ | ||
{ name = "xarray Developers", email = "[email protected]" }, | ||
] | ||
authors = [{ name = "xarray Developers", email = "[email protected]" }] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: Apache Software License", | ||
|
@@ -22,11 +20,7 @@ name = "xarray" | |
readme = "README.md" | ||
requires-python = ">=3.10" | ||
|
||
dependencies = [ | ||
"numpy>=1.24", | ||
"packaging>=23.2", | ||
"pandas>=2.1", | ||
] | ||
dependencies = ["numpy>=1.24", "packaging>=23.2", "pandas>=2.1"] | ||
|
||
# We don't encode minimum requirements here (though if we can write a script to | ||
# generate the text from `min_deps_check.py`, that's welcome...). We do add | ||
|
@@ -70,6 +64,7 @@ types = [ | |
"types-PyYAML", | ||
"types-Pygments", | ||
"types-colorama", | ||
"types-decorator", | ||
"types-defusedxml", | ||
"types-docutils", | ||
"types-networkx", | ||
|
@@ -93,10 +88,7 @@ dask = "xarray.namedarray.daskmanager:DaskManager" | |
|
||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"setuptools>=42", | ||
"setuptools-scm>=7", | ||
] | ||
requires = ["setuptools>=42", "setuptools-scm>=7"] | ||
|
||
[tool.setuptools] | ||
packages = ["xarray"] | ||
|
@@ -120,10 +112,7 @@ exclude_lines = ["pragma: no cover", "if TYPE_CHECKING"] | |
|
||
[tool.mypy] | ||
enable_error_code = ["ignore-without-code", "redundant-self", "redundant-expr"] | ||
exclude = [ | ||
'build', | ||
'xarray/util/generate_.*\.py', | ||
] | ||
exclude = ['build', 'xarray/util/generate_.*\.py'] | ||
files = "xarray" | ||
show_error_context = true | ||
warn_redundant_casts = true | ||
|
@@ -254,10 +243,7 @@ module = ["xarray.namedarray.*", "xarray.tests.test_namedarray"] | |
# reportMissingTypeStubs = false | ||
|
||
[tool.ruff] | ||
extend-exclude = [ | ||
"doc", | ||
"_typed_ops.pyi", | ||
] | ||
extend-exclude = ["doc", "_typed_ops.pyi"] | ||
|
||
[tool.ruff.lint] | ||
extend-select = [ | ||
|
@@ -383,3 +369,64 @@ test = "pytest" | |
ignore = [ | ||
"PP308", # This option creates a large amount of log lines. | ||
] | ||
|
||
[tool.typos] | ||
|
||
[tool.typos.default] | ||
extend-ignore-identifiers-re = [ | ||
# Variable names | ||
"nd_.*", | ||
".*_nd", | ||
"ba_.*", | ||
".*_ba", | ||
"ser_.*", | ||
".*_ser", | ||
# Function/class names | ||
"NDArray.*", | ||
".*NDArray.*", | ||
] | ||
|
||
[tool.typos.default.extend-words] | ||
# NumPy function names | ||
arange = "arange" | ||
|
||
# Technical terms | ||
nd = "nd" | ||
nin = "nin" | ||
|
||
# Variable names | ||
ba = "ba" | ||
ser = "ser" | ||
fo = "fo" | ||
iy = "iy" | ||
vart = "vart" | ||
ede = "ede" | ||
|
||
# Organization/Institution names | ||
Stichting = "Stichting" | ||
Mathematisch = "Mathematisch" | ||
|
||
# People's names | ||
Soler = "Soler" | ||
Bruning = "Bruning" | ||
Tung = "Tung" | ||
Claus = "Claus" | ||
Celles = "Celles" | ||
slowy = "slowy" | ||
Commun = "Commun" | ||
|
||
# Tests | ||
Ome = "Ome" | ||
SUR = "SUR" | ||
Tio = "Tio" | ||
Ono = "Ono" | ||
abl = "abl" | ||
|
||
# Technical terms | ||
splitted = "splitted" | ||
childs = "childs" | ||
cutted = "cutted" | ||
LOCA = "LOCA" | ||
|
||
[tool.typos.type.jupyter] | ||
extend-ignore-re = ["\"id\": \".*\""] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is the typos project — it's great in PRQL. There's also a new-ish VSCode extension which has been good