Expand Ruff lint scope to include security checks and remove Bandit from pre-commit. Fix residual style issues to comply with OpenStack rules (79-char lines, delayed logging interpolation). Key changes: - Drop Bandit pre-commit hook; rely on Ruff S-rules - Add S-rule suppressions where usage is intentional (subprocess, mark_safe) - Convert f-string logs to delayed interpolation and wrap lines - Update .pre-commit-config.yaml and project config accordingly Assisted-By: cursor gpt5 Change-Id: I83f78535c1bd2f8bf9bff3247acb52ef744ec416 Signed-off-by: Sean Mooney <work@seanmooney.info>
64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
---
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v5.0.0
|
|
hooks:
|
|
# whitespace
|
|
- id: trailing-whitespace
|
|
- id: mixed-line-ending
|
|
args: ['--fix', 'lf']
|
|
exclude: '.*\.(svg)$'
|
|
- id: check-byte-order-marker
|
|
# file format and permissions
|
|
- id: check-ast
|
|
- id: debug-statements
|
|
- id: check-json
|
|
files: .*\.json$
|
|
- id: check-yaml
|
|
files: .*\.(yaml|yml)$
|
|
- id: check-executables-have-shebangs
|
|
- id: check-shebang-scripts-are-executable
|
|
# git
|
|
- id: check-added-large-files
|
|
- id: check-case-conflict
|
|
- id: detect-private-key
|
|
- id: check-merge-conflict
|
|
exclude: '.*\.(rst|inc)$'
|
|
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
|
rev: v1.5.5
|
|
hooks:
|
|
- id: remove-tabs
|
|
exclude: '.*\.(svg)$'
|
|
- repo: https://opendev.org/openstack/hacking
|
|
rev: 7.0.0
|
|
hooks:
|
|
- id: hacking
|
|
additional_dependencies: []
|
|
exclude: '^(doc|releasenotes|tools)/.*$'
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.12.1
|
|
hooks:
|
|
- id: ruff-check
|
|
args: ['--fix', '--unsafe-fixes']
|
|
- repo: https://github.com/hhatto/autopep8
|
|
rev: v2.3.2
|
|
hooks:
|
|
- id: autopep8
|
|
files: '^.*\.py$'
|
|
- repo: https://github.com/codespell-project/codespell
|
|
rev: v2.4.1
|
|
hooks:
|
|
- id: codespell
|
|
args: ['--ignore-words=doc/dictionary.txt']
|
|
- repo: https://github.com/sphinx-contrib/sphinx-lint
|
|
rev: v1.0.0
|
|
hooks:
|
|
- id: sphinx-lint
|
|
args: [--enable=default-role]
|
|
files: ^doc/|^releasenotes/|^api-guide/
|
|
types: [rst]
|
|
- repo: https://github.com/PyCQA/doc8
|
|
rev: v1.1.2
|
|
hooks:
|
|
- id: doc8
|