Skip to content

Commit 74de6c8

Browse files
committed
chore: modernize ruff config to work with ruff >= v0.2
1 parent 08af4b9 commit 74de6c8

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.github/workflows/test_full.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868
- name: Ruff format
6969
run: ruff format --check ninja tests
7070
- name: Ruff lint
71-
run: ruff ninja tests
71+
run: ruff check ninja tests
7272
- name: mypy
7373
run: mypy ninja tests/mypy_test.py

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Alternatively, manually check your code with:
5353

5454
```
5555
ruff format --check ninja tests
56-
ruff ninja tests
56+
ruff check ninja tests
5757
mypy ninja
5858
```
5959

@@ -67,7 +67,7 @@ Or reformat your code with:
6767

6868
```
6969
ruff format ninja tests
70-
ruff ninja tests --fix
70+
ruff check ninja tests --fix
7171
```
7272

7373
or using Makefile:

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ install: ## Install dependencies
1111
.PHONY: lint
1212
lint: ## Run code linters
1313
ruff format --preview --check ninja tests
14-
ruff --preview ninja tests
14+
ruff check --preview ninja tests
1515
mypy ninja
1616

1717
.PHONY: fmt format
1818
fmt format: ## Run code formatters
1919
ruff format --preview ninja tests
20-
ruff --preview --fix ninja tests
20+
ruff check --preview --fix ninja tests
2121

2222
.PHONY: test
2323
test: ## Run tests

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ dev = ["pre-commit"]
6868

6969
[tool.ruff]
7070
target-version = "py37"
71+
72+
[tool.ruff.lint]
7173
select = [
7274
"B", # flake8-bugbear
7375
"C", # flake8-comprehensions
@@ -85,7 +87,7 @@ ignore = [
8587
"C901", # too complex
8688
]
8789

88-
[tool.ruff.per-file-ignores]
90+
[tool.ruff.lint.per-file-ignores]
8991
"ninja/compatibility/datastructures.py" = ["C416"]
9092
"ninja/utils.py" = ["B004"]
9193
"tests/*" = ["C408"]

0 commit comments

Comments
 (0)