-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from cclauss/ruff
Add GitHub Action to spellcheck and lint Python code
- Loading branch information
Showing
16 changed files
with
141 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# https://github.com/codespell-project/codespell | ||
# https://beta.ruff.rs | ||
name: lint | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: pip install --user codespell[toml] ruff | ||
- run: codespell | ||
- run: ruff --format=github . |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
[tool.codespell] | ||
ignore-words-list = "fpr,hepler,loos,te,thrid" | ||
|
||
[tool.ruff] | ||
select = [ | ||
"AIR", # Airflow | ||
"ASYNC", # flake8-async | ||
"B", # flake8-bugbear | ||
"C90", # McCabe cyclomatic complexity | ||
"DTZ", # flake8-datetimez | ||
"E", # pycodestyle | ||
"F", # Pyflakes | ||
"FA", # flake8-future-annotations | ||
"FLY", # flynt | ||
"ICN", # flake8-import-conventions | ||
"INT", # flake8-gettext | ||
"ISC", # flake8-implicit-str-concat | ||
"PL", # Pylint | ||
"PT", # flake8-pytest-style | ||
"PYI", # flake8-pyi | ||
"RSE", # flake8-raise | ||
"RUF", # Ruff-specific rules | ||
"T10", # flake8-debugger | ||
"TCH", # flake8-type-checking | ||
"TID", # flake8-tidy-imports | ||
"W", # pycodestyle | ||
"YTT", # flake8-2020 | ||
# "A", # flake8-builtins | ||
# "ANN", # flake8-annotations | ||
# "ARG", # flake8-unused-arguments | ||
# "BLE", # flake8-blind-except | ||
# "C4", # flake8-comprehensions | ||
# "COM", # flake8-commas | ||
# "D", # pydocstyle | ||
# "DJ", # flake8-django | ||
# "EM", # flake8-errmsg | ||
# "ERA", # eradicate | ||
# "EXE", # flake8-executable | ||
# "FBT", # flake8-boolean-trap | ||
# "FIX", # flake8-fixme | ||
# "G", # flake8-logging-format | ||
# "I", # isort | ||
# "INP", # flake8-no-pep420 | ||
# "N", # pep8-naming | ||
# "NPY", # NumPy-specific rules | ||
# "PD", # pandas-vet | ||
# "PGH", # pygrep-hooks | ||
# "PIE", # flake8-pie | ||
# "PLR091", # Pylint Refactor just for max-args, max-branches, etc. | ||
# "PTH", # flake8-use-pathlib | ||
# "Q", # flake8-quotes | ||
# "RET", # flake8-return | ||
# "S", # flake8-bandit | ||
# "SIM", # flake8-simplify | ||
# "SLF", # flake8-self | ||
# "T20", # flake8-print | ||
# "TD", # flake8-todos | ||
# "TRY", # tryceratops | ||
# "UP", # pyupgrade | ||
] | ||
ignore = [ | ||
"B007", | ||
"B904", | ||
"E401", | ||
"E402", | ||
"E711", | ||
"E712", | ||
"E713", | ||
"E722", | ||
"E731", | ||
"F401", | ||
"F403", | ||
"F405", | ||
"F841", | ||
"PLR0402", | ||
"PLW2901", | ||
"RUF005", | ||
] | ||
line-length = 142 | ||
target-version = "py37" | ||
|
||
[tool.ruff.mccabe] | ||
max-complexity = 16 | ||
|
||
[tool.ruff.pylint] | ||
allow-magic-value-types = ["bytes", "int", "str"] | ||
max-args = 11 | ||
max-branches = 20 | ||
max-returns = 7 | ||
max-statements = 56 | ||
|
||
[tool.ruff.per-file-ignores] | ||
"__init__.py" = ["E402"] | ||
"test/*" = ["S101"] |
This file contains 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