-
Notifications
You must be signed in to change notification settings - Fork 0
Bring all shell into the lint surface #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ set -euo pipefail | |
|
|
||
| shell_roots=() | ||
| has_shell_roots=0 | ||
| for root in scripts home/dot_config/zsh home/.chezmoitemplates .github/actions; do | ||
| for root in scripts home/dot_config/zsh home/.chezmoitemplates home/dot_claude .github/actions; do | ||
| if [[ -d "${root}" ]]; then | ||
| shell_roots+=("${root}") | ||
| has_shell_roots=1 | ||
|
|
@@ -63,7 +63,7 @@ mise exec -- prettier --check . | |
|
|
||
| shell_roots=() | ||
| has_shell_roots=0 | ||
| for root in scripts home/dot_config/zsh home/.chezmoitemplates .github/actions; do | ||
| for root in scripts home/dot_config/zsh home/.chezmoitemplates home/dot_claude .github/actions; do | ||
| if [[ -d "${root}" ]]; then | ||
| shell_roots+=("${root}") | ||
| has_shell_roots=1 | ||
|
|
@@ -82,6 +82,20 @@ if ((has_shell_roots)); then | |
| fi | ||
| fi | ||
|
|
||
| # bats files use a test DSL that shfmt would reflow, so lint them with shellcheck only. | ||
| # Severity stays at warning because bats idioms (literal-string assertions, per-test | ||
| # subshells) trip info-level checks that are not real bugs. | ||
| if [[ -d tests ]]; then | ||
| bats_targets=() | ||
| while IFS= read -r bats_target; do | ||
| bats_targets+=("${bats_target}") | ||
| done < <(find tests -type f -name '*.bats') | ||
|
|
||
| if [[ -n "${bats_targets[*]:-}" ]]; then | ||
| mise exec -- shellcheck --shell=bash --severity=warning "${bats_targets[@]}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Existing tests use native Bats Useful? React with 👍 / 👎. |
||
| fi | ||
| fi | ||
|
|
||
| mise exec -- taplo fmt --check | ||
| ''' | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the CI lint job runs
mise lint, this narrowed disable leaves the other variables populated only througheval "$(jq ...)"(effort,used,remaining,total_cost,current_dir,worktree,agent_name) uncovered; ShellCheck's SC2154 documentation explicitly says it does not infer dynamic assignments such aseval var=value. Withhome/dot_claudenow inshell_roots, lint will still fail on those references rather than bringing this script into the lint surface.Useful? React with 👍 / 👎.