Repository navigation
fix(scripts): the SPDX recipe also repairs the first form of the template rule - #662
Conversation
…late rule
The recipe had 1 target: the `head -1` rule. A linter with the first form
of the template rule was not a target and kept that form. That form stops
only at a line in column 1 (`/^[^#[:space:]]/`), so a workflow with an
indented body passes with a licence line after the body. The template
repaired this in rsr-template-repo pull request 323. The linter of
system-et has the first form.
The recipe now has a second target: a line that is exactly
`if ! awk '<first form>' "$name"; then`. Only the rule text changes on
that line. The 2 comment lines and the echo line are already there.
- `scripts/fix-workflow-linter-spdx-rule.sh`: the second target. One awk
function finds it, for the `--check` count and for the repair, so the 2
cannot disagree. The rule text is compared as a literal, not as a
pattern.
- `tests/template-drift-recipes-test.sh`: 2 cases. The first form is
repaired to the same file that the `head -1` repair gives, and the test
shows the defect of the first form before the repair. The rule text in a
line of another shape is not a target.
- `campaigns/TEMPLATE-DRIFT-CAMPAIGN.adoc`: the target, the evidence and
the limit.
Evidence: on the linter of system-et at `main` (bbe1d13), the count is 1
before and 0 after, 1 line changes, and the step is identical to the step
of the template at `main` (0208563). With the old script, the new test
fails ("expected 1, got 0").
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZmiFSCoB3UR9Kk56rK
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |



Summary
scripts/fix-workflow-linter-spdx-rule.shhad 1 target: thehead -1rule. #659 recorded the gap as a limit: a linter with the first form of the template rule is not a target, and keeps that form.The first form stops only at a line in column 1 (
/^[^#[:space:]]/). A workflow with an indented body then passes the lint with a licence line after the body. The template repaired this inrsr-template-repopull request 323. The linter ofsystem-etstill has the first form.This pull request makes the first form a second target.
Changes
scripts/fix-workflow-linter-spdx-rule.sh: the second target is a line that is exactlyif ! awk '<first form>' "$name"; then. Only the rule text changes on that line: the 2 comment lines and theecholine are already correct in such a file.--checkand the repair both use it, so the count and the repair cannot disagree.tests/template-drift-recipes-test.sh: 2 cases.head -1repair gives. Before the repair, the test shows the defect: the first form accepts a licence line after an indented body.campaigns/TEMPLATE-DRIFT-CAMPAIGN.adoc: the target in the recipe table, the evidence, and the limit (2 targets, not 1).The recipes are still not dispatched. This change does not touch the automation quarantine.
Testing
bash tests/template-drift-recipes-test.sh:PASS: registry routes, predicates, exact repairs, idempotence, refusals and symlink rejection for 3 recipes.fix-workflow-linter-spdx-rule.sh --check spdx-form2: expected 1, got 0.system-etatmain(bbe1d13).--checkgives 1 before and 0 after. 1 line changes. TheCheck SPDX Headersstep is then identical to the step of the template atmain(0208563), 19 lines.bash -non the script: no error.shellcheckis not installed in the session, so it was not run. The awk of the session is mawk 1.3.4.Not verified: the number of repositories that have the first form. No estate scan was made.
Generated by Claude Code