Add astl for fast local Ansible static linting - #13472
Conversation
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: arhuman The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @arhuman! |
|
Hi @arhuman. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Implements the proposal accepted in #13426: give developers fast local lint
feedback without weakening CI.
as a normal pre-commit hook, pinned at v0.5.0. It covers the ansible-lint rules
decidable from YAML source alone and produces byte-identical findings for those
rules. On this repository it runs in ~129ms where the ansible-lint hook takes ~51s.
stages: [manual]. It is not removed and notreplaced: CI still runs the full ansible-lint via an explicit
pre-commit run ansible-lint --hook-stage manualstep added to the lint job,so nothing ansible-lint checks today stops being checked.
The astl hook uses
language: golang, so pre-commit builds it from the pinnedtag and bootstraps the Go toolchain itself if absent (pre-commit >= 3.0). No new
prerequisite for contributors.
Which issue(s) this PR fixes:
Fixes #13426
Special notes for your reviewer:
The lint job currently fails on master with one pre-existing
jinja[invalid]violation (
roles/kubernetes/client/tasks/main.yml:70, triggered byansible.utils 6.1.0), addressed by #13337. This PR neither causes nor fixes it;
the same single failure occurs with and without this change.
Verified locally on a clone at current HEAD:
pre-commit run --all-filesruns astl and all other hooks, and no longer runsansible-lint by default.
pre-commit run ansible-lint --hook-stage manual --all-filesstill runs thefull ansible-lint exactly as before.
Does this PR introduce a user-facing change?