ci(lint): enable and gate ansible-lint's complexity rule #138

Open
opened 2026-11-14 21:50:50 +00:00 by Claude · 2 comments
Owner

Spec: Role standard, resolution comment, "Complexity".

What

In .ansible-lint, add enable_list: [complexity] and warn_list: []. With an empty warn list, findings from experimental rules fail Lint. Keep the default max_tasks (100): the key cannot be set, because ansible-lint's config schema rejects it (reproduced on 26.10.1; see the separate issue to lower it). Add a one-line comment with the reason.

Acceptance

Lint passes on main. A throwaway task file with 101 tasks fails Lint locally (do not commit it).

Spec: [Role standard](https://git.rkdr.net/Mortis/Kamino/issues/93), resolution comment, "Complexity". ## What In `.ansible-lint`, add `enable_list: [complexity]` and `warn_list: []`. With an empty warn list, findings from experimental rules fail Lint. Keep the default `max_tasks` (100): the key cannot be set, because ansible-lint's config schema rejects it (reproduced on 26.10.1; see the separate issue to lower it). Add a one-line comment with the reason. ## Acceptance Lint passes on main. A throwaway task file with 101 tasks fails Lint locally (do not commit it).
Claude added the
Status
Ready for Agent
label 2026-11-14 21:50:50 +00:00
Claude added this to the Continuous delivery milestone 2026-11-15 22:21:20 +00:00
Author
Owner

Review of the map (2026-11-15): corrections to this issue.

  • warn_list: [] promotes more than experimental rules. The issue says "With an empty warn list, findings from experimental rules fail Lint." ansible-lint's default warn list (26.10.1, config.py DEFAULT_WARN_LIST) is experimental, jinja[spacing] and fqcn[deep]. An empty list also makes jinja[spacing] and fqcn[deep] findings fatal, which is a change no decision asked for. An implementer may then "fix" it with scattered noqa. Change: either set warn_list: [jinja[spacing], fqcn[deep]] (keeps today's behaviour and gates only the experimental rules, complexity among them), or state that promoting both is intended. In both cases, run the repository's real Lint with the change on a branch, and list in the PR every new finding it reports.
  • The acceptance tests only a throwaway file. At the default of 100 nothing in the repository is flagged, so a green Lint proves little. Change: add "report the largest task counts that ansible-lint finds in roles/ (molecule files included)", which is also the input the follow-up that lowers the limit to 40 needs.
Review of the map (2026-11-15): corrections to this issue. - **`warn_list: []` promotes more than experimental rules.** The issue says "With an empty warn list, findings from experimental rules fail Lint." ansible-lint's default warn list (26.10.1, `config.py` `DEFAULT_WARN_LIST`) is `experimental`, `jinja[spacing]` and `fqcn[deep]`. An empty list also makes `jinja[spacing]` and `fqcn[deep]` findings fatal, which is a change no decision asked for. An implementer may then "fix" it with scattered `noqa`. Change: either set `warn_list: [jinja[spacing], fqcn[deep]]` (keeps today's behaviour and gates only the experimental rules, `complexity` among them), or state that promoting both is intended. In both cases, run the repository's real Lint with the change on a branch, and list in the PR every new finding it reports. - **The acceptance tests only a throwaway file.** At the default of 100 nothing in the repository is flagged, so a green Lint proves little. Change: add "report the largest task counts that ansible-lint finds in `roles/` (molecule files included)", which is also the input the follow-up that lowers the limit to 40 needs.
Author
Owner

Decided by Role interface and semver: output facts, handler names, dropped platforms and internal roles (2026-11-20)

  • warn_list: []: promoting jinja[spacing] and fqcn[deep] is intended. On a scratch copy (2026-11-20) with warn_list: [] and complexity enabled there were no findings of either rule or of complexity, so Lint stays green.
  • Also in this PR: remove role-name from skip_list and add roles/_binary_update role-name to .ansible-lint-ignore, moving the explaining comment with it, so a misnamed public role fails. Tested on the same copy: Lint passes with that line.
  • The existing acceptance (list every new finding Lint reports, and the largest task counts) still applies.
## Decided by [Role interface and semver: output facts, handler names, dropped platforms and internal roles](https://git.rkdr.net/Mortis/Kamino/issues/257) (2026-11-20) - **`warn_list: []`**: promoting `jinja[spacing]` and `fqcn[deep]` is intended. On a scratch copy (2026-11-20) with `warn_list: []` and `complexity` enabled there were no findings of either rule or of `complexity`, so Lint stays green. - **Also in this PR:** remove `role-name` from `skip_list` and add `roles/_binary_update role-name` to `.ansible-lint-ignore`, moving the explaining comment with it, so a misnamed public role fails. Tested on the same copy: Lint passes with that line. - The existing acceptance (list every new finding Lint reports, and the largest task counts) still applies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#138