-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ruff for pre-commit checks; replaces isort and flake8 (#549)
* Use ruff for pre-commit checks; replaces isort and flake8 * Update changelog to include link to this PR * feat: switch to ruff * feat: apply formatting changes * deps: pre-commit autoupdate * fixup some black formatting * fixup, docs: changelog * fix: add I to ruff rules --------- Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
- Loading branch information
Showing
37 changed files
with
185 additions
and
182 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 |
---|---|---|
@@ -1,54 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: "v0.0.267" | ||
hooks: | ||
- id: isort | ||
language_version: python3.8 | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- repo: https://github.com/psf/black | ||
rev: 22.12.0 | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
args: ["--safe"] | ||
language_version: python3.8 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
language_version: python3.8 | ||
args: [ | ||
# E501 let black handle all line length decisions | ||
# W503 black conflicts with "line break before operator" rule | ||
# E203 black conflicts with "whitespace before ':'" rule | ||
"--ignore=E501,W503,E203,C901", | ||
] | ||
- repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle | ||
# 2.1.1 | ||
rev: v2.1.1 | ||
hooks: | ||
- id: pydocstyle | ||
language_version: python3.8 | ||
exclude: ".*(test|alembic|scripts).*" | ||
args: | ||
[ | ||
# Check for docstring presence only | ||
"--select=D1", | ||
] | ||
# Don't require docstrings for tests | ||
# '--match=(?!test).*\.py'] | ||
# - | ||
# repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: v0.770 | ||
# hooks: | ||
# - id: mypy | ||
# language_version: python3.8 | ||
# args: [--no-strict-optional, --ignore-missing-imports] | ||
- repo: https://github.com/PyCQA/pydocstyle | ||
rev: 6.3.0 | ||
hooks: | ||
- id: pydocstyle | ||
language_version: python3.8 | ||
exclude: ".*(test|alembic|scripts).*" | ||
#args: [ | ||
# Don't require docstrings for tests | ||
#'--match=(?!test|alembic|scripts).*\.py', | ||
#] |
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 |
---|---|---|
@@ -1,11 +1,21 @@ | ||
[flake8] | ||
ignore = "D203" | ||
exclude = [".git", "__pycache__", "docs/source/conf.py", "build", "dist"] | ||
max-complexity = 12 | ||
max-line-length = 90 | ||
[tool.ruff] | ||
line-length = 90 | ||
select = [ | ||
"C9", | ||
"D1", | ||
"E", | ||
"F", | ||
"I", | ||
"W", | ||
] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
known_first_party = "stac_fastapi" | ||
known_third_party = ["stac-pydantic", "fastapi"] | ||
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] | ||
[tool.ruff.per-file-ignores] | ||
"**/tests/**/*.py" = ["D1"] | ||
|
||
[tool.ruff.isort] | ||
known-first-party = ["stac_fastapi"] | ||
known-third-party = ["stac_pydantic", "fastapi"] | ||
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] | ||
|
||
[tool.black] | ||
target-version = ["py38", "py39", "py310", "py311"] |
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 |
---|---|---|
@@ -1 +1 @@ | ||
"""api submodule.""" | ||
"""Api submodule.""" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"""library version.""" | ||
"""Library version.""" | ||
__version__ = "2.4.6" |
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 |
---|---|---|
@@ -1 +1 @@ | ||
"""extensions submodule.""" | ||
"""Extensions submodule.""" |
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
Oops, something went wrong.