diff --git a/.gitea/workflows/reusable-ansible-role-lint.yaml b/.gitea/workflows/reusable-ansible-role-lint.yaml index 2b6f641..ce4124e 100644 --- a/.gitea/workflows/reusable-ansible-role-lint.yaml +++ b/.gitea/workflows/reusable-ansible-role-lint.yaml @@ -67,5 +67,6 @@ jobs: # role-name is a warning: the roles keep galaxy's skeleton meta and # are named ericomeehan. by the playbooks, which galaxy's # naming rule rejects. Everything else counts. + # .gitea/ holds CI workflows, which actionlint checks, not ansible-lint. # shellcheck disable=SC2086 # EXTRA_ARGS is a list of flags - ansible-lint --nocolor -f pep8 --warn-list role-name $EXTRA_ARGS + ansible-lint --nocolor -f pep8 --warn-list role-name --exclude .gitea $EXTRA_ARGS diff --git a/docs/ci-cd/adding-ci.md b/docs/ci-cd/adding-ci.md index d8c73f0..9f20ed4 100644 --- a/docs/ci-cd/adding-ci.md +++ b/docs/ci-cd/adding-ci.md @@ -71,13 +71,21 @@ docker run --rm -v "$PWD:/src" -w /tmp gitea.eom.dev/devops/ci-tools:1.0.0 bash mkdir -p /tmp/roles && cp -a /src /tmp/roles/ericomeehan.NAME && ln -s /tmp/roles/ericomeehan.NAME /tmp/roles/ansible-role-NAME && cd /tmp/roles/ericomeehan.NAME && - ANSIBLE_ROLES_PATH=/tmp/roles ansible-lint --warn-list role-name --generate-ignore; + ANSIBLE_ROLES_PATH=/tmp/roles ansible-lint --warn-list role-name --exclude .gitea --generate-ignore; cp .ansible-lint-ignore /src/' ``` Replace `NAME`. Baselined findings still print, as warnings. Fixing them later means deleting lines from `.ansible-lint-ignore`. +The baseline is per file and rule, not per line. A new finding of a rule that +is already baselined in the same file (say a second `name[casing]` in +`tasks/main.yml`) only warns. New rules, and any finding in a new file, fail. +Shrink the baseline as files are cleaned up, so it covers less over time. + +`.gitea/` is excluded: workflow files are checked by actionlint, not +ansible-lint. + ### Helm chart ```yaml