Harden yaml linting on modified files
Allows us to slowly adopt yamllint by having to fix only the files we would be touching. Once we lower the amount of differences we can switch it to run on all files. In addition to having a more consistent code-style this solves *recurring* bugs like duplicate dictionary keys, like the one fixes in this change. Only few weeks ago we had to fix a similar bug. Change-Id: I2ef275700b420a0f700613568e43576079cd4d03
This commit is contained in:
parent
a554bed7e0
commit
baf8392455
|
@ -1,5 +1,25 @@
|
||||||
---
|
---
|
||||||
repos:
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v1.4.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: check-byte-order-marker
|
||||||
|
- id: check-executables-have-shebangs
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: debug-statements
|
||||||
|
- id: check-yaml
|
||||||
|
files: .*\.(yaml|yml)$
|
||||||
|
- repo: https://github.com/adrienverge/yamllint.git
|
||||||
|
rev: v1.12.1
|
||||||
|
hooks:
|
||||||
|
- id: yamllint
|
||||||
|
files: \.(yaml|yml)$
|
||||||
|
types: [file, yaml]
|
||||||
|
# uncommend once a new yamllint release is made:
|
||||||
|
# entry: yamllint --strict
|
||||||
|
|
||||||
- repo: https://github.com/openstack-dev/bashate.git
|
- repo: https://github.com/openstack-dev/bashate.git
|
||||||
rev: 0.6.0
|
rev: 0.6.0
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
os_username: "{{ lookup('env','OS_USERNAME') }}"
|
os_username: "{{ lookup('env','OS_USERNAME') }}"
|
||||||
os_password: "{{ lookup('env','OS_PASSWORD') }}"
|
os_password: "{{ lookup('env','OS_PASSWORD') }}"
|
||||||
os_tenant_name: "{{ lookup('env','OS_TENANT_NAME') }}"
|
os_tenant_name: "{{ lookup('env','OS_TENANT_NAME') }}"
|
||||||
|
@ -39,9 +40,8 @@ mtu_interface:
|
||||||
undercloud_local_mtu: "{{ mtu }}"
|
undercloud_local_mtu: "{{ mtu }}"
|
||||||
overcloud_neutron_global_physnet_mtu: "{{ mtu }}"
|
overcloud_neutron_global_physnet_mtu: "{{ mtu }}"
|
||||||
|
|
||||||
run_tripleo_validations: True
|
run_tripleo_validations: true
|
||||||
|
|
||||||
# Browbeat settings
|
# Browbeat settings
|
||||||
cloud_name: rdocloud
|
|
||||||
elastic_host: browbeat.test.com
|
elastic_host: browbeat.test.com
|
||||||
grafana_host: browbeat.test.com
|
grafana_host: browbeat.test.com
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
# note the EC2MetadataIp: value should match the value in
|
# note the EC2MetadataIp: value should match the value in
|
||||||
# /home/stack/undercloud.conf for key local_ip
|
# /home/stack/undercloud.conf for key local_ip
|
||||||
# # EC2MetadataIp: "local_ip"
|
# # EC2MetadataIp: "local_ip"
|
||||||
|
@ -19,4 +20,4 @@ parameter_defaults:
|
||||||
ControlPlaneSubnetCidr: "24"
|
ControlPlaneSubnetCidr: "24"
|
||||||
ControlPlaneDefaultRoute: 192.0.2.1
|
ControlPlaneDefaultRoute: 192.0.2.1
|
||||||
EC2MetadataIp: 192.0.2.1
|
EC2MetadataIp: 192.0.2.1
|
||||||
DnsServers: ["192.168.23.1", "8.8.8.8",]
|
DnsServers: ["192.168.23.1", "8.8.8.8"]
|
||||||
|
|
|
@ -4,7 +4,6 @@ floating_ip_cidr: "{{ undercloud_network_cidr }}"
|
||||||
public_net_pool_start: "{{ floating_ip_cidr|nthhost(100) }}"
|
public_net_pool_start: "{{ floating_ip_cidr|nthhost(100) }}"
|
||||||
public_net_pool_end: "{{ floating_ip_cidr|nthhost(120) }}"
|
public_net_pool_end: "{{ floating_ip_cidr|nthhost(120) }}"
|
||||||
public_net_gateway: "{{ floating_ip_cidr|nthhost(1) }}"
|
public_net_gateway: "{{ floating_ip_cidr|nthhost(1) }}"
|
||||||
tempest_log_file: 'tempest_output.log'
|
|
||||||
test_white_regex: "{{ test_regex|default('smoke') }}"
|
test_white_regex: "{{ test_regex|default('smoke') }}"
|
||||||
test_black_regex: []
|
test_black_regex: []
|
||||||
check_tempest_bugs: false
|
check_tempest_bugs: false
|
||||||
|
@ -67,7 +66,13 @@ tempest_until_failure: false
|
||||||
tempest_exit_on_failure: true
|
tempest_exit_on_failure: true
|
||||||
# Set tempest_version for different release
|
# Set tempest_version for different release
|
||||||
# For forked-tempest, we have branched name in synced with releases.
|
# For forked-tempest, we have branched name in synced with releases.
|
||||||
tempest_version_dict: { 'newton': 'newton', 'ocata': '16.1.0', 'pike': '17.1.0', 'queens': '17.2.0', 'rocky': '19.0.0', 'master': 'master'}
|
tempest_version_dict:
|
||||||
|
newton: 'newton'
|
||||||
|
ocata: '16.1.0'
|
||||||
|
pike: '17.1.0'
|
||||||
|
queens: '17.2.0'
|
||||||
|
rocky: '19.0.0'
|
||||||
|
master: 'master'
|
||||||
tempest_version: "{{ tempest_version_dict[release] }}"
|
tempest_version: "{{ tempest_version_dict[release] }}"
|
||||||
tempest_conf_version_dict: {'ocata': '1.1.3', 'pike': '1.1.3', 'queens': '1.1.4', 'rocky': 'master', 'master': 'master'}
|
tempest_conf_version_dict: {'ocata': '1.1.3', 'pike': '1.1.3', 'queens': '1.1.4', 'rocky': 'master', 'master': 'master'}
|
||||||
tempest_conf_version: "{{ tempest_conf_version_dict[release] }}"
|
tempest_conf_version: "{{ tempest_conf_version_dict[release] }}"
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -50,7 +50,10 @@ commands = bash -c ci-scripts/releasenotes_tox.sh
|
||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
commands =
|
commands =
|
||||||
{[testenv:bashate]commands}
|
# check only modified files:
|
||||||
|
python -m pre_commit run --source HEAD^ --origin HEAD
|
||||||
|
# in the future we may want to check entire repository:
|
||||||
|
# python -m pre_commit run yamllint --all-files
|
||||||
{[testenv:pep8]commands}
|
{[testenv:pep8]commands}
|
||||||
{[testenv:ansible-lint]commands}
|
{[testenv:ansible-lint]commands}
|
||||||
{[testenv:validate-jinja]commands}
|
{[testenv:validate-jinja]commands}
|
||||||
|
|
Loading…
Reference in New Issue