From 0d8f0fe04728007e54ccd09aea056cea550aa097 Mon Sep 17 00:00:00 2001 From: Carlo Kroll Date: Fri, 30 Aug 2024 16:00:41 +0100 Subject: [PATCH 1/5] Optimize linting setup - utilize solely Ruff --- .github/workflows/qc.yml | 4 ++-- pyproject.toml | 11 +++-------- tox.ini | 4 ---- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 6eb596f..1e62bdc 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -29,8 +29,8 @@ jobs: - name: Check common spelling errors run: poetry run tox -e codespell - - name: Check code quality with flake8 - run: poetry run tox -e lint + - name: Check code quality with ruff + run: poetry run tox -e py$(echo ${{ matrix.python-version }} | tr -d .) - name: Test with pytest and generate coverage file run: poetry run tox -e py diff --git a/pyproject.toml b/pyproject.toml index 8179e41..318483b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,6 +109,7 @@ extend-ignore = [ "D212", # `multi-line-summary-first-line` ] +# Allow autofix for all enabled rules (when `--fix`) is provided. fixable = ["ALL"] # Select or ignore from https://beta.ruff.rs/docs/rules/ @@ -125,7 +126,8 @@ select = [ unfixable = [] # Unlike Flake8, default to a complexity level of 10. -mccabe = { max-complexity = 10 } +[tool.ruff.lint.mccabe] +max-complexity = 10 [tool.ruff.lint.isort] known-third-party = ["duckdb"] @@ -136,13 +138,6 @@ count = "" quiet-level = 3 # ignore-words-list = "" -[tool.isort] -profile = "black" -multi_line_output = 3 -line_length = 100 -include_trailing_comma = true -reverse_relative = true - [build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"] build-backend = "poetry_dynamic_versioning.backend" diff --git a/tox.ini b/tox.ini index dbdef3f..1575640 100644 --- a/tox.ini +++ b/tox.ini @@ -34,22 +34,18 @@ commands = coverage erase # This is used during development [testenv:lint-fix] deps = - black ruff skip_install = true commands = - black src/ tests/ --exclude "/(tests/input|tests/output)/" ruff --fix src/ tests/ --exclude tests/input --exclude tests/output description = Run linters. # This is used for QC checks. [testenv:lint] deps = - black ruff skip_install = true commands = - black --check --diff src/ tests/ --exclude "/(tests/input|tests/output)/" ruff check src/ tests/ --exclude tests/input --exclude tests/output description = Run linters. From 0d24bce54cd6ac0f5a76aefea3a7f8b34446e3d9 Mon Sep 17 00:00:00 2001 From: Carlo Kroll Date: Fri, 30 Aug 2024 17:53:11 +0100 Subject: [PATCH 2/5] corrected poetry tox linting call --- .github/workflows/qc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 1e62bdc..2cead20 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -30,7 +30,7 @@ jobs: run: poetry run tox -e codespell - name: Check code quality with ruff - run: poetry run tox -e py$(echo ${{ matrix.python-version }} | tr -d .) + run: poetry run tox -e lint$(echo ${{ matrix.python-version }} | tr -d .) - name: Test with pytest and generate coverage file run: poetry run tox -e py From 5ed90ba1eddeb0507ba478d939293c6461f48c2a Mon Sep 17 00:00:00 2001 From: Carlo Kroll Date: Fri, 30 Aug 2024 18:02:48 +0100 Subject: [PATCH 3/5] correcting ruff lint call --- .github/workflows/qc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 2cead20..c4278a9 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -30,7 +30,7 @@ jobs: run: poetry run tox -e codespell - name: Check code quality with ruff - run: poetry run tox -e lint$(echo ${{ matrix.python-version }} | tr -d .) + run: poetry run tox -e lint-py$(echo ${{ matrix.python-version }} sed 's/[^0-9]//g') - name: Test with pytest and generate coverage file run: poetry run tox -e py From 64113a8cd7a127118429faea9a2832c54627046f Mon Sep 17 00:00:00 2001 From: Carlo Kroll Date: Fri, 30 Aug 2024 18:03:14 +0100 Subject: [PATCH 4/5] adding pipe --- .github/workflows/qc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index c4278a9..0ec214d 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -30,7 +30,7 @@ jobs: run: poetry run tox -e codespell - name: Check code quality with ruff - run: poetry run tox -e lint-py$(echo ${{ matrix.python-version }} sed 's/[^0-9]//g') + run: poetry run tox -e lint-py$(echo ${{ matrix.python-version }} | sed 's/[^0-9]//g') - name: Test with pytest and generate coverage file run: poetry run tox -e py From f6a036a41d87c80447caa14a4a9ec7f55f0e907f Mon Sep 17 00:00:00 2001 From: Carlo Kroll Date: Fri, 30 Aug 2024 18:55:32 +0100 Subject: [PATCH 5/5] try to fix --- .github/workflows/qc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 0ec214d..0e66790 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -30,7 +30,7 @@ jobs: run: poetry run tox -e codespell - name: Check code quality with ruff - run: poetry run tox -e lint-py$(echo ${{ matrix.python-version }} | sed 's/[^0-9]//g') + run: poetry run tox -e lint - name: Test with pytest and generate coverage file run: poetry run tox -e py