Integrate pre-commit
Just as we've done for Nova and many other projects. Change-Id: I40410f637fcb1b05724a4ed7106e557c07006164 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
41
.pre-commit-config.yaml
Normal file
41
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.6.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: mixed-line-ending
|
||||||
|
args: ['--fix', 'lf']
|
||||||
|
exclude: '.*\.(svg)$'
|
||||||
|
- id: check-byte-order-marker
|
||||||
|
- id: check-executables-have-shebangs
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: debug-statements
|
||||||
|
- id: check-json
|
||||||
|
files: .*\.json$
|
||||||
|
- id: check-yaml
|
||||||
|
files: .*\.(yaml|yml)$
|
||||||
|
- 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: 6.1.0
|
||||||
|
hooks:
|
||||||
|
- id: hacking
|
||||||
|
additional_dependencies: []
|
||||||
|
exclude: '^(doc|releasenotes|tools)/.*$'
|
||||||
|
# TODO(stephenfin): Uncomment this
|
||||||
|
# - repo: https://github.com/hhatto/autopep8
|
||||||
|
# rev: v2.3.1
|
||||||
|
# hooks:
|
||||||
|
# - id: autopep8
|
||||||
|
# files: '^.*\.py$'
|
||||||
|
# - repo: https://github.com/sphinx-contrib/sphinx-lint
|
||||||
|
# rev: v0.9.1
|
||||||
|
# hooks:
|
||||||
|
# - id: sphinx-lint
|
||||||
|
# args: [--enable=default-role]
|
||||||
|
# files: ^doc/|releasenotes|api-guide
|
||||||
|
# types: [rst]
|
@@ -107,7 +107,6 @@ tests:
|
|||||||
status: 200
|
status: 200
|
||||||
response_json_paths:
|
response_json_paths:
|
||||||
$.allocation_requests.`len`: 2
|
$.allocation_requests.`len`: 2
|
||||||
status: 200
|
|
||||||
|
|
||||||
- name: verify microversion fail for multiple member_of params
|
- name: verify microversion fail for multiple member_of params
|
||||||
GET: /allocation_candidates?resources=VCPU:1,MEMORY_MB:1024,DISK_GB:100&member_of=$ENVIRON['AGGA_UUID']&member_of=$ENVIRON['AGGB_UUID']
|
GET: /allocation_candidates?resources=VCPU:1,MEMORY_MB:1024,DISK_GB:100&member_of=$ENVIRON['AGGA_UUID']&member_of=$ENVIRON['AGGB_UUID']
|
||||||
|
@@ -32,10 +32,6 @@ tests:
|
|||||||
status: 406
|
status: 406
|
||||||
response_headers:
|
response_headers:
|
||||||
content-type: /application/json/
|
content-type: /application/json/
|
||||||
response_json_paths:
|
|
||||||
$.errors.[0].title: Not Acceptable
|
|
||||||
$.errors.[0].max_version: /^\d+\.\d+$/
|
|
||||||
$.errors.[0].min_version: /^\d+\.\d+$/
|
|
||||||
response_strings:
|
response_strings:
|
||||||
- "Unacceptable version header: 0.5"
|
- "Unacceptable version header: 0.5"
|
||||||
response_json_paths:
|
response_json_paths:
|
||||||
|
5
tox.ini
5
tox.ini
@@ -36,8 +36,11 @@ commands =
|
|||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
description =
|
description =
|
||||||
Run style checks.
|
Run style checks.
|
||||||
|
skip_install = true
|
||||||
|
deps =
|
||||||
|
pre-commit
|
||||||
commands =
|
commands =
|
||||||
bash tools/flake8wrap.sh {posargs}
|
pre-commit run --all-files --show-diff-on-failure
|
||||||
|
|
||||||
[testenv:fast8]
|
[testenv:fast8]
|
||||||
description =
|
description =
|
||||||
|
Reference in New Issue
Block a user