Experiment with ruff

The cool new Python linting tool.

"tox -e ruff" to check and
"tox -e ruff -- --fix" to auto-fix code.

This isn't approved in openstack/requirements at this time,
but developers might like trying it out.

Change-Id: I7d39f9043d607b174a53d804a57235a62bbfa6d8
This commit is contained in:
Eric Harney 2023-04-19 10:58:19 -04:00
parent 8f5373ac3c
commit 4092805978
2 changed files with 12 additions and 0 deletions

5
ruff.toml Normal file
View File

@ -0,0 +1,5 @@
# hacking already covers E402 (and disagrees w/ ruff)
ignore = ["E402"]
[per-file-ignores]
"cinder/volume/drivers/fungible/swagger_api_client.py" = ["E501"]

View File

@ -280,3 +280,10 @@ paths = ./cinder/tests/hacking
[doc8]
ignore-path=.tox,*.egg-info,doc/src/api,doc/source/drivers.rst,doc/build,.eggs,doc/source/configuration/tables,./*.txt,releasenotes,doc/source/contributor/api,doc/test
extension=.txt,.rst,.inc
[testenv:ruff]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
ruff
commands =
ruff {toxinidir}/cinder {posargs}