diff --git a/.flake8 b/.flake8 deleted file mode 100644 index e5d1fda..0000000 --- a/.flake8 +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -exclude = .git,.tox,__pycache__,.eggs,dist,.venv* -max-line-length = 88 -extend-ignore = W503,W504,E203 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f1835a8..bc55171 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,27 +15,17 @@ repos: rev: 0.31.0 hooks: - id: check-github-workflows - - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 - hooks: - - id: pyupgrade - args: ["--py39-plus"] - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.10.0 - hooks: - - id: black - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 + rev: 7.3.0 hooks: - id: flake8 - additional_dependencies: - - 'flake8-bugbear==24.12.12' - - 'flake8-comprehensions==3.16.0' - - 'flake8-typing-as-t==1.0.0' - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort + additional_dependencies: [flake8-typing-as-t] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.15.14 + hooks: + - id: ruff-check + args: [--fix] + - id: ruff-format - repo: https://github.com/sirosen/slyp rev: 0.8.1 hooks: diff --git a/pyproject.toml b/pyproject.toml index 6a4151d..290afb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,9 +95,16 @@ ignore_missing_imports = true disallow_subclassing_any = false files = ["src"] -[tool.isort] -profile = "black" -known_first_party = ["mddj"] +[tool.ruff] +line-length = 88 +show-fixes = true + +[tool.ruff.lint] +select = ["E4", "E7", "E9", "F", "B", "C4", "I", "TCH", "UP"] +ignore = ["E203"] + +[tool.ruff.lint.isort] +known-first-party = ["dependency_groups"] [tool.check-sdist] git-only = [".*", "Makefile", "docs/*", "scripts/*"] diff --git a/scripts/bump-version.py b/scripts/bump-version.py index 5d643fd..abcc3ce 100755 --- a/scripts/bump-version.py +++ b/scripts/bump-version.py @@ -37,7 +37,7 @@ def update_changelog(new_version): ---------- {new_version} -{'-' * len(new_version)} +{"-" * len(new_version)} """, content,