Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize linting setup - utilize solely Ruff #78

Merged
merged 5 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Check common spelling errors
run: poetry run tox -e codespell

- name: Check code quality with flake8
- name: Check code quality with ruff
run: poetry run tox -e lint

- name: Test with pytest and generate coverage file
Expand Down
11 changes: 3 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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"]
Expand All @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading