From 4092805978fc8c7947738c3d008a29a223920274 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 19 Apr 2023 10:58:19 -0400 Subject: [PATCH] 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 --- ruff.toml | 5 +++++ tox.ini | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 ruff.toml diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000000..95e6f82a71d --- /dev/null +++ b/ruff.toml @@ -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"] diff --git a/tox.ini b/tox.ini index 25e262c091a..3b6108280b9 100644 --- a/tox.ini +++ b/tox.ini @@ -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}