Repository navigation
feat(lint): make bash_local_underscore_prefix an error - #251
Conversation
Scanning the user's tracked bash found 12 findings, all real violations and no false positives. Closes #248 Refs #169 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
|
Review summary: no findings. The change is a one-line severity bump (warning to error) plus new valid and invalid rule tests. I read the rule and the new test cases and found no correctness or security problems. The inside check matches only the direct parent, so local flags such as -a, -n, -i and -A and command substitutions are not flagged, which matches the new valid cases. The new invalid cases are matched by the existing variable_assignment and variable_name branches. I did not run ast-grep test myself, because sg on this runner is probably the shadow-utils command. I am relying on the PR's stated result of 28 passing rules. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b85ab4bf24
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary: no findings. The change flips I did not run No P0–P3 issues. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06fcc7e66a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary: no findings. The change flips |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🤖 I have created a release *beep* *boop* --- ## [0.3.0](v0.2.0...v0.3.0) (2026-11-19) ### Features * **lint:** fit the bash and yaml model rule cutoffs ([#243](#243)) ([d5eab6b](d5eab6b)) * **lint:** fit the Go model rules on eval fixtures ([#244](#244)) ([cf87c36](cf87c36)) * **lint:** fit the Rust model rules to eval fixtures ([#241](#241)) ([3275ce2](3275ce2)) * **lint:** fit the TypeScript model rules on eval fixtures ([#242](#242)) ([bb41bb7](bb41bb7)) * **lint:** make bash_local_underscore_prefix an error ([#251](#251)) ([cd8c5b8](cd8c5b8)) ### Bug Fixes * **hooks:** let cleanup_worktrees remove worktrees left with only regenerable outputs ([#235](#235)) ([a25ce5b](a25ce5b)) * **hooks:** raise the model rules subject cap and keep cached findings under it ([#246](#246)) ([a451e93](a451e93)) * **hooks:** show each Stop model-rule finding once per session ([#252](#252)) ([49cd6f9](49cd6f9)) * **hooks:** skip commits already on the default branch in model rules ([#247](#247)) ([3df49a2](3df49a2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
bash_local_underscore_prefixをseverity: errorにする(ADR-0021「Static rules block」,ユーザー決定:ast-grep の規則はすべて error).規則の本体は変えていない.Closes #248
Refs #169
調査
user の非 archive repository(obsidian と archive 済みの apple-mail-cli,reflex-state,k8s-guideline-bench を除く)の tracked な bash(
.sh,.bash,.bats,および bash/sh の shebang を持つファイル,計 67 件)に規則をかけた.読み取りのみで,agent-config 以外は変更していない.run_all_ex100.sh,run_timing_ex100.shの関数内local script,local name,local log(各 3 件).tests/esa/zsh.batsの@test内local marked_file,recovery_file,expected_calls(計 6 件).bats の@testは関数に展開されるため,関数ローカル変数として本物の違反.誤検知は 0 件.追加で,規則が誤って反応しうる形(
local -a/-n/-i/-A,1 行に複数の変数,文字列中のlocal,$(...)内のlocal,大文字名のIFS)を手元で当てても検出は出なかった.テスト
rule-tests/bash_local_underscore_prefix.ymlに追加(ast-grep test --skip-snapshot-testsで全 28 規則が通過).local -a/-n/-i/-Aの宣言,1 行の複数変数,文字列中のlocal,代入の$(...)local -r src=...,local _src=... dstレビュー指摘の扱い
noteに修正方法が無い,ADR-0021 の契約): 修正済み.noteの先頭にlocal src="$1"→local _src="$1"の例を足した.local src="$src"の右辺の外側変数まで改名させる): 修正済み.改名するのは宣言名と宣言後の参照で,右辺で読む外側変数は除くとnoteに明記した.範囲外
既存コードの違反の修正(Issue の受け入れ条件どおり,CI は PR が足した行だけを見る).他の規則,CI や hook の配線,他 repository のコード.
🤖 Generated with Claude Code