Skip to content

Commit 59f005d

Browse files
committedOct 21, 2024
pre-commit: Bump versions
... and use native hooks for bandit and hacking Change-Id: Iaafe890b48eb7607064b70f51253d38b3bd933aa
1 parent 204c09b commit 59f005d

File tree

3 files changed

+11
-30
lines changed

3 files changed

+11
-30
lines changed
 

‎.pre-commit-config.yaml

+10-19
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
# We from the Oslo project decided to pin repos based on the
2-
# commit hash instead of the version tag to prevend arbitrary
3-
# code from running in developer's machines. To update to a
4-
# newer version, run `pre-commit autoupdate` and then replace
5-
# the newer versions with their commit hash.
6-
7-
default_language_version:
8-
python: python3
9-
101
repos:
112
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: 9136088a246768144165fcc3ecc3d31bb686920a # v3.3.0
3+
rev: v5.0.0
134
hooks:
145
- id: trailing-whitespace
156
# Replaces or checks mixed line ending
@@ -27,13 +18,13 @@ repos:
2718
- id: debug-statements
2819
- id: check-yaml
2920
files: .*\.(yaml|yml)$
30-
- repo: local
21+
- repo: https://opendev.org/openstack/hacking
22+
rev: 7.0.0
3123
hooks:
32-
- id: flake8
33-
name: flake8
34-
additional_dependencies:
35-
- hacking>=6.1.0,<6.2.0
36-
language: python
37-
entry: flake8
38-
files: '^.*\.py$'
39-
exclude: '^(doc|releasenotes|tools)/.*$'
24+
- id: hacking
25+
additional_dependencies: []
26+
- repo: https://github.com/PyCQA/bandit
27+
rev: 1.7.10
28+
hooks:
29+
- id: bandit
30+
args: ['-x', 'tests,benchmark', '--skip', 'B404']

‎test-requirements.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
hacking>=6.1.0,<6.2.0 # Apache-2.0
2-
31
fixtures>=3.0.0 # Apache-2.0/BSD
42
testtools>=2.2.0 # MIT
53
stestr>=2.0.0 # Apache-2.0
@@ -9,8 +7,3 @@ oslotest>=3.2.0 # Apache-2.0
97

108
# rootwrap daemon's client should be verified to run in eventlet
119
eventlet>=0.18.2 # MIT
12-
13-
# Bandit security code scanner
14-
bandit>=1.7.0,<1.8.0 # Apache-2.0
15-
16-
pre-commit>=2.6.0 # MIT

‎tox.ini

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ commands =
1616

1717
[testenv:pep8]
1818
deps =
19-
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
20-
-r{toxinidir}/test-requirements.txt
19+
pre-commit>=2.6.0 # MIT
2120
commands =
2221
pre-commit run -a
23-
# Run security linter
24-
bandit -r oslo_rootwrap tests -n5 --skip B404
2522

2623
[testenv:cover]
2724
deps = {[testenv]deps}

0 commit comments

Comments
 (0)
Please sign in to comment.