Skip to content

Commit c3635c6

Browse files
committed
Update pre-commit and clean nosec comments
1 parent 5057713 commit c3635c6

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ repos:
44
hooks:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
7+
78
- repo: https://github.com/astral-sh/ruff-pre-commit
89
rev: v0.15.0
910
hooks:
1011
- id: ruff-check
1112
args: [--fix]
13+
files: ^(master/(master\.cfg|custom_steps\.py|buildbot\.tac)|worker/buildbot\.tac)$
14+
types_or: [python, text]
1215
- id: ruff-format
16+
files: ^(master/(master\.cfg|custom_steps\.py|buildbot\.tac)|worker/buildbot\.tac)$
17+
types_or: [python, text]
18+
1319
- repo: https://github.com/PyCQA/bandit
1420
rev: 1.9.3
1521
hooks:
1622
- id: bandit
17-
args: ["-c", "pyproject.toml"]
23+
args: ["-c", "pyproject.toml", "master/master.cfg", "master/custom_steps.py", "master/buildbot.tac", "worker/buildbot.tac"]
24+
pass_filenames: false
25+
always_run: true
26+
additional_dependencies: [ "bandit[toml]" ]
1827

1928
- repo: https://github.com/codespell-project/codespell
2029
rev: v2.4.1
@@ -25,7 +34,9 @@ repos:
2534
rev: v2.14
2635
hooks:
2736
- id: vulture
37+
args: ["master/master.cfg", "master/custom_steps.py", "master/buildbot.tac", "worker/buildbot.tac"]
2838
pass_filenames: false
39+
always_run: true
2940

3041
- repo: local
3142
hooks:

master/custom_steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import xml.etree.ElementTree as Xml # nosec B405 -- XML comes from trusted CTest output
1+
import xml.etree.ElementTree as Xml # nosec B405
22

33
from buildbot.process.buildstep import BuildStepFailed, BuildStep, ShellMixin
44
from buildbot.steps.worker import CompositeStepMixin
@@ -68,7 +68,7 @@ def run(self):
6868
ctest_log = yield self.getFileContentFromWorker(xml_results[0], abandonOnFailure=True)
6969

7070
# Parse the result, collecting test failures into more convenient logs.
71-
root = Xml.fromstring(ctest_log) # nosec B314 -- XML comes from trusted CTest output
71+
root = Xml.fromstring(ctest_log) # nosec B314
7272

7373
for test in root.findall(".//Test[@Status='failed']"):
7474
log = yield self.addLog(test.findtext("Name", "unknown"))

0 commit comments

Comments
 (0)