Skip to content
Open
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
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.6
rev: v0.15.21
hooks:
# Run the formatter.
- id: ruff-format
# Run the linter.
- id: ruff-check
args: [ '--fix' ]
args: [--fix, --show-fixes]
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 2.17 (unreleased)

* Add support for Python 3.15 and drop 3.9 (Hugo van Kemenade, #416).
* Add pylint and refurb ruff rules (even-even).

# 2.16 (2026-03-25)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ of "Fixed issue12.". Please make sure that you only fix the issue at hand
or implement the desired new feature instead of making "drive-by" changes
like adding type hints.

### Formating and linting
### Formatting and linting

Run `pre-commit` using:

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ select = [
"UP", # pyupgrade
"RUF", # ruff-specific rules
"PERF", # perflint
"FURB", # refurb
"PLE", # pylint (errors)
"PLW", # pylint (warnings)
]
ignore = [
"C408", # unnecessary dict call
Expand Down
8 changes: 4 additions & 4 deletions tests/test_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def test_complex_conditions():
("foo and (False or [])", True, False),
('(foo and bar) or {"a": 1}', False, True),
]
for condition, always_false, always_true in conditions:
condition = ast.parse(condition, mode="eval").body
for condition_str, always_false, always_true in conditions:
condition = ast.parse(condition_str, mode="eval").body
assert not (always_false and always_true)
assert utils.condition_is_always_false(condition) == always_false
assert utils.condition_is_always_true(condition) == always_true
Expand All @@ -68,7 +68,7 @@ def test_errors():
"locals()",
"().__class__",
]
for condition in conditions:
condition = ast.parse(condition, mode="eval").body
for condition_str in conditions:
condition = ast.parse(condition_str, mode="eval").body
assert not utils.condition_is_always_false(condition)
assert not utils.condition_is_always_true(condition)
4 changes: 2 additions & 2 deletions vulture/noqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def parse_noqa(code):
for lineno, line in enumerate(code, start=1):
match = NOQA_REGEXP.search(line)
if match:
for error_code in _parse_error_codes(match):
error_code = NOQA_CODE_MAP.get(error_code, error_code)
for raw_error_code in _parse_error_codes(match):
error_code = NOQA_CODE_MAP.get(raw_error_code, raw_error_code)
noqa_lines[error_code].add(lineno)
return noqa_lines

Expand Down
4 changes: 2 additions & 2 deletions vulture/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def get_modules(paths):

"""
modules = []
for path in paths:
path = path.resolve()
for given_path in paths:
path = given_path.resolve()
if path.is_file():
if path.suffix == ".pyc":
sys.exit(f"Error: *.pyc files are not supported: {path}")
Expand Down
Loading