From 3b20a1b6c68d174e2491a8a0aa3564db417f6104 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 26 Nov 2026 19:12:09 +0000 Subject: [PATCH] ci(lint): enable and gate ansible-lint's complexity rule Enable complexity at the default max_tasks and empty warn_list so experimental findings fail Lint. Replace the repository-wide role-name skip with an ignore line for the internal role _binary_update, so a misnamed public role fails. Closes #138 Assisted-by: Claude Code:claude-opus-5-5 --- .ansible-lint | 9 +++++---- .ansible-lint-ignore | 3 +++ roles/AGENTS.md | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index ee591d8..1bae4dc 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -24,7 +24,8 @@ exclude_paths: supported_ansible_also: - "2.22." -skip_list: - # role-name requires ^[a-z][a-z0-9_]*$, which rejects the leading underscore that marks an - # internal role (_binary_update), as in prometheus.prometheus (roles/_common). - - role-name +# complexity runs at the default max_tasks (100) until the schema accepts the key (#139). An empty +# warn_list makes experimental rules (complexity), jinja[spacing] and fqcn[deep] fail Lint. +enable_list: + - complexity +warn_list: [] diff --git a/.ansible-lint-ignore b/.ansible-lint-ignore index 47f9f68..49bc08a 100644 --- a/.ansible-lint-ignore +++ b/.ansible-lint-ignore @@ -9,3 +9,6 @@ roles/_binary_update/molecule/check_mode/verify.yml var-naming[no-role-prefix] roles/_binary_update/molecule/default/verify.yml var-naming[no-role-prefix] roles/_binary_update/molecule/default/tasks/assert_state.yml var-naming[no-role-prefix] roles/_binary_update/molecule/resources/roles/binary_update_caller/tasks/main.yml var-naming[no-role-prefix] +# role-name requires ^[a-z][a-z0-9_]*$, which rejects the leading underscore that marks an +# internal role (_binary_update), as in prometheus.prometheus (roles/_common). +roles/_binary_update role-name diff --git a/roles/AGENTS.md b/roles/AGENTS.md index 9f63791..fa2ad14 100644 --- a/roles/AGENTS.md +++ b/roles/AGENTS.md @@ -18,7 +18,7 @@ names a check that does not exist yet and its backlog issue. *Why:* a consumer finds the same thing in the same place. *Held:* review. - **Complexity.** A task file stays within ansible-lint's `complexity` limit, `max_tasks` 100 (40 once ansible-lint accepts the key). *Why:* a long task file is hard to review. *Held:* - review until the Lint job enables `complexity` and fails on it (#138). + control, ansible-lint `complexity` in the Lint job. - **Roadmap.** The pull request that adds a role removes it from the README "Roadmap" list, and the section goes when the list is empty. *Why:* the list is useful only if true. *Held:* review. @@ -125,4 +125,5 @@ names a check that does not exist yet and its backlog issue. review that each new internal role has it. - **`role-name` for internal roles.** An internal role is exempted from ansible-lint `role-name` by its own line in `.ansible-lint-ignore`. *Why:* a misnamed public role must still fail. - *Held:* review; until #138 replaces it, `.ansible-lint` skips `role-name` repository-wide. + *Held:* control, ansible-lint `role-name` in the Lint job; review that each new internal role + has its line. -- 2.43.0