Skip to content

shell: shellcheck findings fail as warnings, strict optional checks, shfmt -s (part of #14676) - #14709

Merged
TrapsterDK merged 3 commits into
mainfrom
cloud/14676
Nov 23, 2026
Merged

TrapsterDK merged 3 commits into
mainfrom
cloud/14676

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Linked Issue

Part of #14676

Changes

  • shellcheck row passes severity(default = "warning"), so style, info and note findings fail the default --fail-on warning. Regenerated tools_registry.bzl and severity_gen.rs.
  • core/quality/tiers/shellcheck/standard.shellcheckrc and strict.shellcheckrc set external-sources=true.
  • Strict keeps add-default-case, check-extra-masked-returns, check-set-e-suppressed, check-unassigned-uppercase, deprecate-which and drops the excluded checks (avoid-negated-conditions, avoid-nullary-conditions, quote-safe-variables, require-double-brackets, require-variable-braces, useless-use-of-cat). Checked against the pinned shellcheck 0.11.0: the rc parses and SC2249/SC2230 fire.
  • shfmt check and fix run with -s. -ln stays at shfmt's default auto, which already reads the shebang.
  • docs/cli/commands/quality.md documents both.
  • commands_tests.rs argv assertions for shfmt updated.

Not in this PR: the set -euo pipefail and reasonless # shellcheck disable= guard checks (no shared agent-guard hook exists yet, see #14647 item 6), and --check-sourced (the gcc parser rejects findings in files that were not passed in).

Verification

Tested: bazel test //core/quality/adapter:quality_adapter_test //core/quality/adapter:update_severity_test //core/quality:tools_registry_test //core/quality:registry_unit //core/quality:tools_unit //core/quality:unavailable_rows_test //docs:update_tool_configs_test //docs:update_tiers_tests //cli/generate:update_tools_test — all 10 passed.

Not run: tools/dx check --apply on the touched files. In this cloud container it analyzed far past the touched packages and failed on unrelated packages (the opam-repository archive returns 403 through the proxy, plus aspect errors in //lua/private/coverage and //rust/tests/fixtures/native_call).


Generated by Claude Code

TrapsterDK commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Red affected tests shards here come from main, not this PR. Each listed test fails on the base commit 4d1324d without this diff (reproduced locally):

  • shard 13: //elixir/tests/conformance:coverage_test.
  • shard 11: //csharp/tests/fixtures/xunit:csharp_coverage_test_on.
  • shard 10: //core/tests:pins.
  • shard 15: //gazelle/csharp:generation_test, //gazelle/julia:stdlib_test, //gazelle/ocaml:ocaml_test.
  • shard 4: //core/modules:consumer_deps_test, //core/modules:versions_contract (plus //core/modules/tests:loaders_test in the same package).

Shard 24 (//tools/docs/site:*, //tools/docs/typescript/extract:dx_docs_typescript_extract_test) sits in the same main-wide red; not re-run here. The diff touches only shellcheck/shfmt config and the quality adapter.


Generated by Claude Code

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Merge train: dropped, docs/cli/commands/quality.md conflicts with main (the perlcritic paragraph from #14711 landed next to the new shellcheck/shfmt paragraphs); core/quality/tools_registry.bzl also needs regenerating. Rebase onto main and re-queue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS

Copy link
Copy Markdown
Collaborator Author

Merged origin/main into the branch (9754afe) and regenerated core/quality/tools_registry.bzl, severity_gen.rs and the tool-config docs; docs/cli/commands/quality.md merged cleanly. Re-ran //core/quality/adapter:quality_adapter_test //core/quality/adapter:update_severity_test //core/quality:tools_registry_test //core/quality:registry_unit //core/quality:tools_unit //core/quality:unavailable_rows_test //docs:update_tool_configs_test //docs:update_tiers_tests //cli/generate:update_tools_test: all pass. Re-queued with train.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

#14711 landed and re-conflicted docs/cli/commands/quality.md. Merged origin/main again (9000fbf): the perlcritic paragraph and the shellcheck/shfmt paragraphs both stay, in that order. Generated files re-checked; //core/quality/adapter:quality_adapter_test //core/quality/adapter:update_severity_test //core/quality:tools_registry_test //core/quality:tools_unit //docs:update_tool_configs_test //docs:update_tiers_tests pass. train label is on.


Generated by Claude Code

@TrapsterDK

TrapsterDK commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Fixed: conflict already resolved on the branch by merge 9000fbf (another session, pushed while I was working). That merge keeps both the perlcritic paragraph from #14711 and the shellcheck/shfmt paragraphs in docs/cli/commands/quality.md. It also regenerates core/quality/tools_registry.bzl and severity_gen.rs: the shellcheck row has "default": "warning" and the new floor field. I rebased separately onto origin/main ac1d0f3 and regenerated with Bazel. My tree matched 9000fbf on every file this PR touches, so I did not force-push over it. On that tree, bazel test //core/quality/adapter:quality_adapter_test //core/quality/adapter:update_severity_test //core/quality:tools_registry_test //core/quality:registry_unit //core/quality:tools_unit //core/quality:unavailable_rows_test //docs:update_tool_configs_test //docs:update_tiers_tests //cli/generate:update_tools_test: 10 tests pass. PR now reports MERGEABLE.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS

TrapsterDK commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Red affected tests shards, none from this PR (net diff vs main: shellcheck/shfmt config, quality adapter, generated registry, four lines in quality.md; no tools/ci change):

  • shard 3: //cli/adopt:dx_adopt_test (go_files_get_the_gopls_tier_view), same failure on main ac1d0f3.
  • shard 5: //core/modules:versions_contract, red on main.
  • shard 12: //deploy/private/release:dx_release_tools_test TIMEOUT on the runner; passes locally in 38s on main and this branch.
  • shard 24 (f80df46): the //tools/ci guard tests plus //tools/docs/languages:languages_test and //tools/docs/ir/ir:site_shard_test. They were selected because the branch history touched tools/ci/command_docs_allowlist.txt. Ran four locally on this branch: none of the findings name a file this PR changes. prose_rules_test flags docs/design/*.md word counts, unreferenced_files_test flags orphan targets in core/flutter/java/kotlin/scala, zero_compat_test flags a powershell/BUILD.bazel alias, config_consistency_test flags the README .bazelversion. The shell checks in config_consistency_test pass.
  • shards 10, 11, 13, 15, 25: shown red on main in the earlier comment.

Generated by Claude Code

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Merge train: dropped, //tools/ci:command_docs_test fails (passes on main): new: quality.md unknown-flag -s; fix the page or the grammar.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS

claude and others added 2 commits November 23, 2026 09:33
…shfmt -s (part of #14676)

shellcheck gets severity(default = "warning"), so style and info findings
fail the default --fail-on. Both tiers set external-sources=true. Strict
keeps add-default-case, check-extra-masked-returns, check-set-e-suppressed,
check-unassigned-uppercase and deprecate-which, and drops the noisy
optional checks. shfmt runs with -s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzCY9baSVjcqMb5hoA
The quality page now names shfmt's -s flag, which is a tool flag, not a
dx quality flag, like the -c and --features entries already listed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Fixed: //tools/ci:command_docs_test failed with new: quality.md unknown-flag -s because the new shfmt paragraph names shfmt's -s flag, which is not a dx quality flag. Added quality.md unknown-flag -s to tools/ci/command_docs_allowlist.txt, next to the existing tool-flag entries -c and --features. Rebased onto origin/main b326408 (linear history, the earlier merge commits are gone). bazel test //tools/ci:command_docs_test //core/quality/adapter:quality_adapter_test //core/quality/adapter:update_severity_test //core/quality:tools_registry_test //core/quality:registry_unit //core/quality:tools_unit //core/quality:unavailable_rows_test //docs:update_tool_configs_test //docs:update_tiers_tests //cli/generate:update_tools_test: 11 tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS

…(part of #14676)

The routine forbids growing allowlists; the page no longer names a flag token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzCY9baSVjcqMb5hoA

Copy link
Copy Markdown
Collaborator Author

//tools/ci:command_docs_test fix: f80df46 (on top of e3d6ddf, no force-push) rewords the quality.md line to "shfmt runs in simplify mode" so the page names no flag token, and drops the quality.md unknown-flag -s allowlist entry e3d6ddf added, since the routine rules say not to grow allowlists. bazel test //tools/ci:command_docs_test //docs:update_tool_configs_test passes. Re-queued with train.


Generated by Claude Code

@TrapsterDK
TrapsterDK merged commit 3766a5c into main Nov 23, 2026
23 of 32 checks passed
@TrapsterDK
TrapsterDK deleted the cloud/14676 branch November 23, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

train Tested; land via merge train

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants