Implements the "Complexity" rule of the role standard (#93), as amended in #138's comments (decided by #257).
.ansible-lint: enable_list: [complexity] and warn_list: []. max_tasks stays at the default of 100 because the config schema rejects the key. #139 lowers it to 40. The empty warn list makes experimental rules (complexity) fail Lint. It also makes jinja[spacing] and fqcn[deep] fail, and #257 decided that is intended. Enabling complexity also turns on complexity[nesting] (block depth, default 20).
role-name is no longer skipped repository-wide. .ansible-lint-ignore exempts only roles/_binary_update, with the explaining comment moved there, so a misnamed public role fails.
roles/AGENTS.md: the Complexity and role-name rules are now held by the ansible-lint control in the Lint job. Their "until #138" wording is removed.
No changelog fragment: Lint config and contributor guidance only, so consumers see no change.
Verified
Locally, with ansible-lint 26.10.1 (the pin) through scripts/ansible-lint.sh:
pre-commit run --all-files passes, and so does the pre-push ansible-test sanity.
New findings Lint reports: none. No complexity, jinja[spacing], fqcn[deep] or role-name failures. The role-name finding on roles/_binary_update shows as ignored.
A throwaway 101-task file in roles/ufw/tasks/ fails with complexity[tasks] (rc=2). Not committed.
A throwaway role roles/BadRole fails with role-name (rc=2). Not committed.
Largest task counts in roles/ (from the same rule with max_tasks patched lower, molecule files included):
File
Tasks
roles/ufw/tasks/service_rules.yml
35
roles/_binary_update/tasks/main.yml
25
roles/ufw/tasks/orphan_rules.yml
24
roles/cloudflared/tasks/configure.yml
23
roles/gitea_runner/tasks/main.yml
19
roles/gitea/tasks/configure.yml
17
roles/traefik/tasks/binary/configure.yml
16
Largest molecule play: roles/traefik/molecule/default/verify.yml, between 21 and 30 tasks. Nothing exceeds 40, so #139 would flag nothing today.
Not verified
The Lint job in CI: its result is on this pull request's run. The local run used the same pinned ansible-lint and collections.
Molecule: not run. The changed files are on the scenario selector's IGNORED list, and no role changed.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code:claude-opus-5-5
## What and why
Closes #138
Implements the "Complexity" rule of the role standard (#93), as amended in #138's comments (decided by #257).
- `.ansible-lint`: `enable_list: [complexity]` and `warn_list: []`. `max_tasks` stays at the default of 100 because the config schema rejects the key. #139 lowers it to 40. The empty warn list makes experimental rules (`complexity`) fail Lint. It also makes `jinja[spacing]` and `fqcn[deep]` fail, and #257 decided that is intended. Enabling `complexity` also turns on `complexity[nesting]` (block depth, default 20).
- `role-name` is no longer skipped repository-wide. `.ansible-lint-ignore` exempts only `roles/_binary_update`, with the explaining comment moved there, so a misnamed public role fails.
- `roles/AGENTS.md`: the Complexity and `role-name` rules are now held by the ansible-lint control in the Lint job. Their "until #138" wording is removed.
No changelog fragment: Lint config and contributor guidance only, so consumers see no change.
## Verified
Locally, with ansible-lint 26.10.1 (the pin) through `scripts/ansible-lint.sh`:
- `pre-commit run --all-files` passes, and so does the pre-push `ansible-test sanity`.
- **New findings Lint reports: none.** No `complexity`, `jinja[spacing]`, `fqcn[deep]` or `role-name` failures. The `role-name` finding on `roles/_binary_update` shows as ignored.
- A throwaway 101-task file in `roles/ufw/tasks/` fails with `complexity[tasks]` (rc=2). Not committed.
- A throwaway role `roles/BadRole` fails with `role-name` (rc=2). Not committed.
- **Largest task counts in `roles/`** (from the same rule with `max_tasks` patched lower, molecule files included):
| File | Tasks |
|---|---|
| `roles/ufw/tasks/service_rules.yml` | 35 |
| `roles/_binary_update/tasks/main.yml` | 25 |
| `roles/ufw/tasks/orphan_rules.yml` | 24 |
| `roles/cloudflared/tasks/configure.yml` | 23 |
| `roles/gitea_runner/tasks/main.yml` | 19 |
| `roles/gitea/tasks/configure.yml` | 17 |
| `roles/traefik/tasks/binary/configure.yml` | 16 |
Largest molecule play: `roles/traefik/molecule/default/verify.yml`, between 21 and 30 tasks. Nothing exceeds 40, so #139 would flag nothing today.
## Not verified
- The Lint job in CI: its result is on this pull request's run. The local run used the same pinned ansible-lint and collections.
- Molecule: not run. The changed files are on the scenario selector's IGNORED list, and no role changed.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code:claude-opus-5-5
Claude
added this to the Continuous delivery milestone 2026-11-26 19:19:54 +00:00
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
CODEOWNERS rules
requested review from Defame1297 2026-11-26 19:19:54 +00:00
Defame1297
scheduled this pull request to auto merge when all checks succeed 2026-11-26 19:30:20 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #138
Implements the "Complexity" rule of the role standard (#93), as amended in #138's comments (decided by #257).
.ansible-lint:enable_list: [complexity]andwarn_list: [].max_tasksstays at the default of 100 because the config schema rejects the key. #139 lowers it to 40. The empty warn list makes experimental rules (complexity) fail Lint. It also makesjinja[spacing]andfqcn[deep]fail, and #257 decided that is intended. Enablingcomplexityalso turns oncomplexity[nesting](block depth, default 20).role-nameis no longer skipped repository-wide..ansible-lint-ignoreexempts onlyroles/_binary_update, with the explaining comment moved there, so a misnamed public role fails.roles/AGENTS.md: the Complexity androle-namerules are now held by the ansible-lint control in the Lint job. Their "until #138" wording is removed.No changelog fragment: Lint config and contributor guidance only, so consumers see no change.
Verified
Locally, with ansible-lint 26.10.1 (the pin) through
scripts/ansible-lint.sh:pre-commit run --all-filespasses, and so does the pre-pushansible-test sanity.New findings Lint reports: none. No
complexity,jinja[spacing],fqcn[deep]orrole-namefailures. Therole-namefinding onroles/_binary_updateshows as ignored.A throwaway 101-task file in
roles/ufw/tasks/fails withcomplexity[tasks](rc=2). Not committed.A throwaway role
roles/BadRolefails withrole-name(rc=2). Not committed.Largest task counts in
roles/(from the same rule withmax_taskspatched lower, molecule files included):roles/ufw/tasks/service_rules.ymlroles/_binary_update/tasks/main.ymlroles/ufw/tasks/orphan_rules.ymlroles/cloudflared/tasks/configure.ymlroles/gitea_runner/tasks/main.ymlroles/gitea/tasks/configure.ymlroles/traefik/tasks/binary/configure.ymlLargest molecule play:
roles/traefik/molecule/default/verify.yml, between 21 and 30 tasks. Nothing exceeds 40, so #139 would flag nothing today.Not verified
NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code:claude-opus-5-5