Upgrade linters

Change-Id: Ie9a560a62a20b97b9a94968e627c834ea5529472
This commit is contained in:
Sorin Sbarnea 2021-02-01 15:05:29 +00:00
parent 8b23749692
commit aa581590b3
11 changed files with 27 additions and 33 deletions

View File

@ -3,8 +3,11 @@ exclude_paths:
parseable: true
quiet: false
skip_list:
- ANSIBLE0010 # Package installs should not use latest.
- 602 # Due to https://github.com/ansible/ansible-lint/issues/457
- 208 # [E208]
- 106 # [E106]
- empty-string-compare # https://github.com/ansible/ansible-lint/issues/457
- role-name # Role name run-test does not match ``^[a-z][a-z0-9_]+$`` pattern
- risky-file-permissions # File permissions unset or incorrect
# TODO(ssbarnea): Remove these in follow-ups
- yaml
verbosity: 1
mock_modules:
- zuul_return

1
.gitignore vendored
View File

@ -21,3 +21,4 @@ scripts/emit_releases_file/assets/
scripts/emit_releases_file/htmlcov/
scripts/emit_releases_file/pytest-report.html
tripleo_ci.egg-info/
.cache

View File

@ -1,19 +1,19 @@
---
repos:
- repo: https://github.com/python/black.git
rev: 19.10b0
rev: 20.8b1
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.7.9
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies:
- flake8-black>=0.1.1
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v3.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
@ -25,19 +25,11 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://gitlab.com/pycqa/flake8
rev: '3.7.9'
rev: '3.8.4'
hooks:
- id: flake8
# commented to allow progressive adoption in smaller patches
# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.18.0
# hooks:
# - id: yamllint
# files: \.(yaml|yml)$
# types: [file, yaml]
# entry: yamllint --strict -f parsable
- repo: https://github.com/ansible/ansible-lint.git
rev: v4.3.5
rev: v5.0.0
hooks:
- id: ansible-lint
always_run: true
@ -46,11 +38,11 @@ repos:
# results when called with individual files.
# https://github.com/ansible/ansible-lint/issues/611
verbose: true
entry: env ANSIBLE_LIBRARY=./library ansible-lint --force-color -p -v .
entry: ansible-lint --force-color -p -v .
additional_dependencies:
- 'ansible<2.10'
- repo: https://github.com/openstack-dev/bashate.git
rev: 0.6.0
rev: 2.0.0
hooks:
- id: bashate
entry: bashate --error . --ignore=E006,E040

View File

@ -74,8 +74,7 @@
changed_when: false
- name: Show the environment passed in to job shell scripts
# noqa 305
shell: env
command: env
args:
executable: /bin/bash
warn: false

View File

@ -2,10 +2,8 @@
- hosts: all
tasks:
- name: remove removal of tmp files
# noqa 303
become: true
shell:
cmd: |
sed -i '/30d/d' /usr/lib/tmpfiles.d/tmp.conf;
sed -i '/10d/d' /usr/lib/tmpfiles.d/tmp.conf
changed_when: true
lineinfile:
path: /usr/lib/tmpfiles.d/tmp.conf
regex: "(10|30)d"
state: absent

View File

@ -41,7 +41,7 @@
- name: Set fact for DLRN tag
set_fact:
provider_dlrn_hash_branch: "{'{{ ci_branch }}': '{{ dlrn_file['content'] | b64decode | trim }}'}"
provider_dlrn_hash_tag_branch: "{'{{ ci_branch }}': '{{ dlrn_file['content'] | b64decode | trim}}'}"
provider_dlrn_hash_tag_branch: "{'{{ ci_branch }}': '{{ dlrn_file['content'] | b64decode | trim }}'}"
- name: Return Zuul data
debug:

View File

@ -238,10 +238,11 @@
- ansible_distribution|lower == "redhat"
become: true
- name: Retrieve built images
- name: Retrieve built images # noqa risky-shell-pipe
shell: "{{ container_cli }} images | grep {{ container_name_prefix }} | awk '{ print $1 }'"
register: built_images
become: true
changed_when: false
- name: Retag and push x86_64 images
when:

View File

@ -9,7 +9,7 @@
msg: "boostrap-subnodes - warning {{ ceph_loop_device }} already exists"
when: dev_loop3_res.stat.exists
- name: Make sure we have losetup installed/latest
- name: Make sure we have losetup installed/latest # noqa: package-latest
become: true
package:
name:

View File

@ -8,7 +8,7 @@
include_role:
name: tripleo-repos
- name: validate that we can install openstack-tripleo-common
- name: validate that we can install openstack-tripleo-common # noqa package-latest
package:
name: openstack-tripleo-common
state: latest

View File

@ -8,7 +8,7 @@
include_role:
name: tripleo-repos
- name: validate that we can install openstack-tripleo-common
- name: validate that we can install openstack-tripleo-common # noqa package-latest
package:
name: openstack-tripleo-common
state: latest

View File

@ -108,7 +108,7 @@
mv /etc/yum.repos.d/fedora-stable.repo /etc/yum.repos.d/delorean-{{ ci_branch | default('master') }}-testing.repo
when: ansible_distribution|lower == "fedora"
- name: Update all installed packages after new repos are setup
- name: Update all installed packages after new repos are setup # noqa package-latest
become: true
package:
name: '*'