enable ruff in pre-commit with some initial lints

Used pycodestyle, pyflakes, flake8-logging-format, and flake8-logging to
bring ruff to the ironic tree.

Change-Id: I4e355b0d2cf065f8844794b14474c34b65e7562b
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
This commit is contained in:
Doug Goldstein 2024-12-06 10:20:20 -06:00
parent d4d4c099c1
commit 231d7f47e5
No known key found for this signature in database
2 changed files with 24 additions and 0 deletions

View File

@ -80,6 +80,11 @@ repos:
rev: v1.1.2
hooks:
- id: doc8
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
hooks:
- id: ruff
args: ['--fix', '--unsafe-fixes']
- repo: local
hooks:
- id: check-releasenotes

View File

@ -4,3 +4,22 @@ build-backend = "pbr.build"
[tool.doc8]
ignore = ["D001"]
[tool.ruff]
line-length = 79
[tool.ruff.lint]
select = [
"E", # pycodestyle (error)
"F", # pyflakes
"G", # flake8-logging-format
"LOG", # flake8-logging
]
[tool.ruff.lint.per-file-ignores]
"ironic/tests/**/*.py" = [
"E402", # module-import-not-at-top-of-file
]
"ironic/drivers/modules/drac/raid.py" = [
"G003", # Logging statement uses `+`
]