Merge "enable ruff in pre-commit with some initial lints"

This commit is contained in:
Zuul 2025-01-08 23:49:06 +00:00 committed by Gerrit Code Review
commit c5023b8a24
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 `+`
]