Skip to content

Commit

Permalink
Replace black, flake8 and isort with ruff for linting and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrm500 committed Dec 13, 2024
1 parent 6541583 commit f4f2052
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 110 deletions.
21 changes: 6 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
repos:
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-ast
- repo: https://github.com/pycqa/isort
rev: 5.13.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: isort
name: isort (python)
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
Expand Down
32 changes: 20 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,41 @@ dependencies = [
"sqlalchemy[mypy]==2.0.36",
]

[tool.black]
[tool.ruff]
line-length = 120
target-version = "py310"

[tool.flake8]
max-line-length = 120
ignore = ['E203', 'W503']
count = true

[tool.isort]
profile = "black"
force_single_line = "true"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C90", # mccabe cyclomatic complexity
"G", # flake8-logging-format
]
ignore = []
exclude = [
"venv*",
".venv*",
"__pycache__",
]
mccabe.max-complexity = 12

[tool.uv]

[dependency-groups]
dev = [
"beautifulsoup4==4.12.3",
"black==24.8.0",
"debugpy==1.8.2",
"djlint==1.34.1",
"flake8-pyproject==1.2.3",
"flake8==7.1.1",
"invoke==2.2.0",
"pre-commit==3.8.0",
"pytest-env==1.1.3",
"pytest-html==4.1.1",
"pytest-mock==3.14.0",
"pytest==8.3.3",
"python-dotenv==1.0.1",
"ruff==0.7.4",
]
112 changes: 29 additions & 83 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f4f2052

Please sign in to comment.