G5: exclude .gitea/ from role lint; document baseline granularity
ansible-lint was flagging callers' workflow files (yaml[truthy] on `on:`), which actionlint already checks. Exclude .gitea/ in the reusable workflow and in the documented baseline command. Note that .ansible-lint-ignore is per file and rule, not per line. Refs DevOps/software-infrastructure#53 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -67,5 +67,6 @@ jobs:
|
||||
# role-name is a warning: the roles keep galaxy's skeleton meta and
|
||||
# are named ericomeehan.<name> 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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user