Skip to content

Commit 4588d43

Browse files
committed
Change from Flake8 to ruff
1 parent 475eae8 commit 4588d43

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
line-length = 88

test-requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
# process, which may cause wedges in the gate later.
44

55
setuptools>=65.0.0,<82 # pkg_resources removed in 82; required by sqlalchemy-migrate
6-
hacking>=7.0.0,<7.1.0 # Apache-2.0
76
coverage!=4.4,>=4.0 # Apache-2.0
87
ddt>=1.2.1 # MIT
98
oslotest>=3.8.0 # Apache-2.0
109
stestr>=4.2.1 # Apache-2.0
11-
flake8>=7.0.0
12-
pyflakes>=3.2.0
10+
ruff>=0.5.0 # MIT

tox.ini

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ minversion = 4.0.2
33
envlist = py3,pep8,cover
44
skipsdist = True
55

6+
[vars]
7+
all_path = {toxinidir}
8+
69
[testenv]
710
usedevelop = True
811
setenv = VIRTUAL_ENV={envdir}
@@ -12,8 +15,21 @@ deps =
1215
git+https://github.com/cloudbase/python-coriolisclient.git
1316
commands = stestr run --slowest --exclude-regex coriolis.tests.integration {posargs}
1417

18+
[testenv:fmt]
19+
description = Format the code based on the coding style standards.
20+
deps =
21+
ruff
22+
commands =
23+
ruff check --select I --fix {[vars]all_path}
24+
ruff format {[vars]all_path}
25+
1526
[testenv:pep8]
16-
commands = flake8 {posargs}
27+
description = Verify the coding style (pep8).
28+
deps =
29+
ruff
30+
commands =
31+
ruff format --diff {[vars]all_path}
32+
ruff check {[vars]all_path}
1733

1834
[testenv:cover]
1935
setenv =
@@ -45,9 +61,3 @@ commands = {posargs}
4561
source = coriolis
4662
omit = coriolis/tests/*
4763

48-
[flake8]
49-
# E125 is deliberately excluded. See https://github.com/jcrocholl/pep8/issues/126
50-
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
51-
52-
ignore = E125,E251,W503,W504,E305,E731,E117,W605,F632,H401,H403,H404,H405,H202
53-
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools

0 commit comments

Comments
 (0)