From 9404c783b497a2fd36480ab6f5abf5cdf889ef0d Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Thu, 20 Aug 2020 15:49:04 +0530 Subject: [PATCH] Use latest ansible-lint we need fix[1] to bypass RepresenterError when using to_yaml filter. This patch also migrates to pycqa/flake8 hooks repo for missing flake8. Adds missing flake8 and ignores some newly added flake8 rules that would be fixed in subsequent patches. [1] https://github.com/ansible/ansible-lint/pull/518 Closes-Bug: #1892056 Change-Id: I40b5ef703a19f7b839ff6f263140ca3cf5c4dfd8 --- .pre-commit-config.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ed54242a..b43451c9f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.1.0 + rev: v3.2.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -10,22 +10,26 @@ repos: - id: check-executables-have-shebangs - id: check-merge-conflict - id: debug-statements + - id: check-yaml + files: .*\.(yaml|yml)$ + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.3 + hooks: - id: flake8 + additional_dependencies: [flake8-typing-imports==1.6.0] entry: flake8 --ignore=E24,E121,E122,E123,E124,E126,E226,E265,E305,E402,F401,F405,E501,E704,F403,F841,W503 # TODO(cloudnull): These codes were added to pass the lint check. # All of these ignore codes should be resolved in # future PRs. - - id: check-yaml - files: .*\.(yaml|yml)$ - repo: https://github.com/adrienverge/yamllint.git - rev: v1.15.0 + rev: v1.24.2 hooks: - id: yamllint files: \.(yaml|yml)$ types: [file, yaml] entry: yamllint --strict -f parsable - repo: https://github.com/ansible/ansible-lint - rev: v4.1.1a2 + rev: v4.3.1 hooks: - id: ansible-lint files: \.(yaml|yml)$ @@ -36,7 +40,7 @@ repos: # Things found within roles.galaxy are external # and not something maintained here. - repo: https://github.com/openstack-dev/bashate.git - rev: 0.6.0 + rev: 2.0.0 hooks: - id: bashate entry: bashate --error . --verbose --ignore=E006,E040