Merge "chore: add pre-commit and hook it into Zuul"
This commit is contained in:
8
.pre-commit-config.yaml
Normal file
8
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.5.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: fix-byte-order-marker
|
||||||
|
- id: check-merge-conflict
|
@@ -39,13 +39,6 @@
|
|||||||
# chdir: "{{ work_dir }}"
|
# chdir: "{{ work_dir }}"
|
||||||
# target: all
|
# target: all
|
||||||
|
|
||||||
- name: Prevent trailing whitespaces
|
|
||||||
shell: find . \! \( -path "*/\.*" -o -path "*/doc/build/*" -o -name "*.tgz" -o -name "*.png" -o -name "*.jpg" \) -type f -exec grep -El " +$" {} \;
|
|
||||||
register: _found_whitespaces
|
|
||||||
failed_when: _found_whitespaces.stdout != ""
|
|
||||||
args:
|
|
||||||
chdir: "{{ work_dir }}"
|
|
||||||
|
|
||||||
- name: Install yamllint
|
- name: Install yamllint
|
||||||
shell: pip3 install -U yq yamllint
|
shell: pip3 install -U yq yamllint
|
||||||
become: yes
|
become: yes
|
||||||
|
5
tox.ini
5
tox.ini
@@ -13,6 +13,11 @@ passenv = *_proxy,*_PROXY
|
|||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
|
[testenv:linters]
|
||||||
|
deps = pre-commit
|
||||||
|
allowlist_externals = pre-commit
|
||||||
|
commands = pre-commit run --all-files --show-diff-on-failure {posargs}
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
deps =
|
deps =
|
||||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||||
|
@@ -23,6 +23,10 @@
|
|||||||
pre-run:
|
pre-run:
|
||||||
- playbooks/inject-keys.yaml
|
- playbooks/inject-keys.yaml
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-helm-pre-commit
|
||||||
|
parent: tox-linters
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-helm-bandit
|
name: openstack-helm-bandit
|
||||||
roles:
|
roles:
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- openstack-helm-linter
|
- openstack-helm-linter
|
||||||
|
- openstack-helm-pre-commit
|
||||||
- openstack-helm-bandit
|
- openstack-helm-bandit
|
||||||
# 2024.1
|
# 2024.1
|
||||||
- openstack-helm-tls-2024-1-ubuntu_jammy # 3 nodes rook
|
- openstack-helm-tls-2024-1-ubuntu_jammy # 3 nodes rook
|
||||||
|
Reference in New Issue
Block a user