From 734b886a67b90915a73b746239e3d09cbab6530c Mon Sep 17 00:00:00 2001 From: Joppe Vos Date: Mon, 4 Dec 2023 15:26:42 +0100 Subject: [PATCH] replace flake8 with ruff --- .pre-commit-config.yaml | 26 ++++++++++++++------------ pyproject.toml | 8 ++++---- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c46e31634..89b252ef5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: mixed-line-ending - id: pretty-format-json - args: ['--autofix'] + args: ["--autofix"] - id: trailing-whitespace - repo: https://github.com/codespell-project/codespell rev: v2.2.6 @@ -59,10 +59,10 @@ repos: args: - --fix - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black - args: [ "--config", "./pyproject.toml" ] + args: ["--config", "./pyproject.toml"] - repo: https://github.com/asottile/blacken-docs rev: 1.16.0 hooks: @@ -70,22 +70,24 @@ repos: alias: black additional_dependencies: [black>=22.10.0] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.6.1' + rev: "v1.7.1" hooks: - id: mypy name: mypy-python - additional_dependencies: [types-PyYAML, types-attrs, attrs, types-requests, types-python-dateutil, apache-airflow] + additional_dependencies: + [ + types-PyYAML, + types-attrs, + attrs, + types-requests, + types-python-dateutil, + apache-airflow, + ] files: ^cosmos - - repo: https://github.com/pycqa/flake8 - rev: 6.1.0 - hooks: - - id: flake8 - entry: pflake8 - additional_dependencies: [pyproject-flake8] ci: autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate skip: - - mypy # build of https://github.com/pre-commit/mirrors-mypy:types-PyYAML,types-attrs,attrs,types-requests, + - mypy # build of https://github.com/pre-commit/mirrors-mypy:types-PyYAML,types-attrs,attrs,types-requests, #types-python-dateutil,apache-airflow@v1.5.0 for python@python3 exceeds tier max size 250MiB: 262.6MiB diff --git a/pyproject.toml b/pyproject.toml index cd90c8d96..2a422566a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -248,10 +248,10 @@ no_warn_unused_ignores = true [tool.ruff] line-length = 120 +[tool.ruff.lint] +select = ["C901"] +[tool.ruff.lint.mccabe] +max-complexity = 8 [tool.distutils.bdist_wheel] universal = true - -[tool.flake8] -max-complexity = 10 -select = "C"