Skip to content

Commit 94937c8

Browse files
committed
Use ruff for pre-commit checks; replaces isort and flake8
1 parent 01bc0d5 commit 94937c8

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
repos:
2-
- repo: https://github.com/PyCQA/isort
3-
rev: 5.12.0
4-
hooks:
5-
- id: isort
6-
language_version: python3.8
2+
-
3+
repo: https://github.com/charliermarsh/ruff-pre-commit
4+
rev: 'v0.0.258'
5+
hooks:
6+
- id: ruff
7+
args:
8+
- --fix
79
-
810
repo: https://github.com/psf/black
911
rev: 22.12.0
1012
hooks:
1113
- id: black
1214
args: ['--safe']
1315
language_version: python3.8
14-
-
15-
repo: https://github.com/pycqa/flake8
16-
rev: 6.0.0
17-
hooks:
18-
- id: flake8
19-
language_version: python3.8
20-
args: [
21-
# E501 let black handle all line length decisions
22-
# W503 black conflicts with "line break before operator" rule
23-
# E203 black conflicts with "whitespace before ':'" rule
24-
'--ignore=E501,W503,E203,C901']
2516
-
2617
repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle
2718
# 2.1.1
@@ -54,4 +45,4 @@ repos:
5445
#args: [
5546
# Don't require docstrings for tests
5647
#'--match=(?!test|alembic|scripts).*\.py',
57-
#]
48+
#]

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Changed
66

77
* Default branch to **main** ([#544](https://github.com/stac-utils/stac-fastapi/pull/544))
8+
* flake8 and isort replaced by ruff for pre-commit checks
89

910
### Fixed
1011

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $ pip install -e stac_fastapi/api[dev]
1212

1313
**Python3.8 only**
1414

15-
This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
15+
This repo is set to use `pre-commit` to run *ruff*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
1616

1717
```bash
1818
$ pre-commit install

pyproject.toml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
[flake8]
2-
ignore = "D203"
3-
exclude = [".git", "__pycache__", "docs/source/conf.py", "build", "dist"]
4-
max-complexity = 12
5-
max-line-length = 90
1+
[tool.ruff]
2+
exclude = [
3+
".git",
4+
"__pycache__",
5+
"docs/source/conf.py",
6+
"build",
7+
"dist"
8+
]
9+
ignore = []
10+
line-length = 90
11+
select = [
12+
"C9",
13+
"E",
14+
"F",
15+
"W",
16+
]
617

7-
[tool.isort]
8-
profile = "black"
9-
known_first_party = "stac_fastapi"
10-
known_third_party = ["rasterio", "stac-pydantic", "sqlalchemy", "geoalchemy2", "fastapi"]
11-
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
18+
[tool.ruff.mccabe]
19+
max-complexity = 12

0 commit comments

Comments
 (0)