diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 82fd9e6..0000000 --- a/.flake8 +++ /dev/null @@ -1,5 +0,0 @@ -[flake8] -max-line-length = 88 -; E203 for black -; B008 does not like fastapi Depends -extend-ignore = E203,B008 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 606cd94..c066acd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,15 +5,6 @@ repos: rev: 22.10.0 hooks: - id: black - - repo: https://github.com/PyCQA/autoflake - rev: v1.7.6 - hooks: - - id: autoflake - args: - - --in-place - - --ignore-init-module-imports - - --remove-all-unused-imports - - --remove-duplicate-keys - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: @@ -21,22 +12,7 @@ repos: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/PyCQA/flake8 - rev: "5.0.4" + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.0.128 hooks: - - id: flake8 - additional_dependencies: ["flake8-bugbear==22.9.11"] - - repo: https://github.com/PyCQA/isort - rev: 5.10.1 - hooks: - - id: isort - - repo: https://github.com/PyCQA/docformatter - rev: v1.5.0 - hooks: - - id: docformatter - args: ["--in-place", "--wrap-summaries=88"] - - repo: https://github.com/asottile/pyupgrade - rev: v3.1.0 - hooks: - - id: pyupgrade - args: ["--py39-plus"] + - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 009a2ee..68bc6e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,25 @@ mypy = [ [project.urls] Home = "https://github.com/sbidoul/runboat" -[tool.isort] -profile = 'black' +[tool.ruff] +fix = false +select = [ + "E", "F", "U", "N", "S", "C", "B", "A", "I", "T", "Q", "YTT", "BLE", "C", "RUF", "M" +] +ignore = [ + "B008", + "BLE001", + "N805", + "N818", + "S101", + "U007", +] + +[tool.ruff.mccabe] +max-complexity = 15 + +[tool.ruff.isort] +known-first-party = ["runboat"] [tool.pytest.ini_options] env_override_existing_values = 1 diff --git a/src/runboat/models.py b/src/runboat/models.py index f2f0656..5729b91 100644 --- a/src/runboat/models.py +++ b/src/runboat/models.py @@ -181,7 +181,7 @@ class Build(BaseModel): async def _deploy( cls, commit_info: CommitInfo, name: str, slug: str, job_kind: k8s.DeploymentMode ) -> None: - """Internal method to prepare for and handle a k8s.deploy()""" + """Internal method to prepare for and handle a k8s.deploy().""" build_settings = settings.get_build_settings( commit_info.repo, commit_info.target_branch )[0]