Skip to content

Commit ab9a545

Browse files
committed
Switch to ruff for formatting (willkg#235)
1 parent 203d004 commit ab9a545

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ help:
1010
test: ## Run tests, linting, and static typechecking
1111
tox
1212

13+
.PHONY: format
14+
format: ## Format files
15+
tox exec -e py38-lint -- ruff format
16+
1317
.PHONY: lint
14-
lint: ## Lint and black reformat files
15-
# NOTE(willkg): Make sure this matches what's in tox.ini.
16-
black src setup.py tests docs examples
18+
lint: ## Lint files
1719
tox -e py38-lint
1820

1921
.PHONY: clean

pyproject.toml

+4-8
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@
22
# Enable pycodestyle (E), pyflakes (F), and bugbear (B) rules
33
select = ["E", "F", "B"]
44

5-
# Ignore line length violations--Black handles those
5+
# Ignore line length violations
66
line-length = 88
77
ignore = ["E501"]
88

9-
target-version = "py37"
9+
target-version = "py38"
1010

1111
src = ["src"]
1212

1313
[tool.ruff.flake8-quotes]
1414
docstring-quotes = "double"
1515

1616

17-
[tool.black]
18-
line-length = 88
19-
target-version = ["py38"]
20-
2117
[tool.mypy]
2218
python_version = "3.8"
2319
disallow_untyped_defs = true
@@ -75,8 +71,8 @@ commands = pytest --doctest-modules src/
7571
basepython = python3.8
7672
changedir = {toxinidir}
7773
commands =
78-
black --diff setup.py tests docs examples
79-
ruff src setup.py tests docs examples
74+
ruff format --check setup.py tests docs examples
75+
ruff check src setup.py tests docs examples
8076
8177
[testenv:py38-typecheck]
8278
basepython = python3.8

requirements-dev.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Requirements file for developing on Everett.
22
-e .[ini,yaml,sphinx]
33

4-
black==23.9.1
54
check-manifest==0.49
65
cogapp==3.3.0
7-
mypy==1.5.1
8-
pytest==7.4.2
9-
ruff==0.0.292
10-
tox==4.11.3
6+
mypy==1.8.0
7+
pytest==7.4.3
8+
ruff==0.1.9
9+
tox==4.11.4
1110
tox-gh-actions==3.1.3
1211
twine==4.0.2
1312
types-PyYAML==6.0.12.12

0 commit comments

Comments
 (0)