Skip to content

Commit 704e13a

Browse files
committed
Use pre-commit to run format check
Change-Id: Ie91c1e1623c9c2712effa98bdbb39a0895677933
1 parent 895751d commit 704e13a

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
# Replaces or checks mixed line ending
7+
- id: mixed-line-ending
8+
args: ['--fix', 'lf']
9+
exclude: '.*\.(svg)$'
10+
# Forbid files which have a UTF-8 byte-order marker
11+
- id: check-byte-order-marker
12+
# Checks that non-binary executables have a proper shebang
13+
- id: check-executables-have-shebangs
14+
# Check for files that contain merge conflict strings.
15+
- id: check-merge-conflict
16+
# Check for debugger imports and py37+ breakpoint()
17+
# calls in python source
18+
- id: debug-statements
19+
- id: check-yaml
20+
files: .*\.(yaml|yml)$
21+
- repo: https://opendev.org/openstack/hacking
22+
rev: 7.0.0
23+
hooks:
24+
- id: hacking
25+
additional_dependencies: []

test-requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Hacking already pins down pep8, pyflakes and flake8
2-
hacking>=6.1.0,<6.2.0 # Apache-2.0
31
coverage>=4.0 # Apache-2.0
42
fixtures>=3.0.0 # Apache-2.0/BSD
53
requests-mock>=1.2.0 # Apache-2.0

tox.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ allowlist_externals = find
1919
commands = oslo_debug_helper -t heatclient/tests {posargs}
2020

2121
[testenv:pep8]
22+
skip_install = true
23+
deps =
24+
pre-commit
2225
commands =
23-
flake8
26+
pre-commit run -a
2427

2528
[testenv:venv]
2629
commands = {posargs}

0 commit comments

Comments
 (0)