diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b43451c9f..5e85f8351 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: - id: check-byte-order-marker - id: check-executables-have-shebangs - id: check-merge-conflict + - id: check-symlinks - id: debug-statements - id: check-yaml files: .*\.(yaml|yml)$ @@ -32,18 +33,12 @@ repos: rev: v4.3.1 hooks: - id: ansible-lint - files: \.(yaml|yml)$ - entry: >- - ansible-lint --force-color -v -x "ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0012,ANSIBLE0013,ANSIBLE0016" - --exclude=tripleo_ansible/roles.galaxy - # TODO(cloudnull): These codes were added to pass the lint check. - # Things found within roles.galaxy are external - # and not something maintained here. - repo: https://github.com/openstack-dev/bashate.git rev: 2.0.0 hooks: - id: bashate - entry: bashate --error . --verbose --ignore=E006,E040 + entry: bashate --error . --ignore=E006,E040 + verbose: false # Run bashate check for all bash scripts # Ignores the following rules: # E006: Line longer than 79 columns (as many scripts use jinja diff --git a/scripts/detect-broken-symlinks.sh b/scripts/detect-broken-symlinks.sh deleted file mode 100755 index 242088265..000000000 --- a/scripts/detect-broken-symlinks.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -## Shell Opts ---------------------------------------------------------------- - -set -o pipefail -set -eu - -## Vars ---------------------------------------------------------------------- - -export PROJECT_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/../" - -## Main ---------------------------------------------------------------------- - -echo 'Checking for broken symlinks: ' -find ${PROJECT_DIR} -type l ! -exec test -e {} \; -print 2>&1 | grep . && exit 1 || (echo clear && exit 0) diff --git a/tox.ini b/tox.ini index 80d5a783b..faad96c1c 100644 --- a/tox.ini +++ b/tox.ini @@ -50,14 +50,14 @@ sitepackages = False setenv = UPPER_CONSTRAINTS_FILE=file:///dev/null deps = - pre-commit - virtualenv<20 # known to break things + pre-commit>=2.7.1 + virtualenv>=20.0.31 -r {toxinidir}/ansible-requirements.txt commands = + pip check bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/tripleo_ansible/roles.galaxy' \ ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml" python -m pre_commit run -a - bash -c '{toxinidir}/scripts/detect-broken-symlinks.sh' [testenv:releasenotes] basepython = python3