Skip to content

Fix ShellCheck findings in lib-deps-check and update-doc-db workflows - #7669

Merged
youknowone merged 1 commit into
RustPython:mainfrom
changjoon-park:fix-shellcheck-workflows
Apr 24, 2026
Merged

Fix ShellCheck findings in lib-deps-check and update-doc-db workflows#7669
youknowone merged 1 commit into
RustPython:mainfrom
changjoon-park:fix-shellcheck-workflows

Conversation

@changjoon-park

@changjoon-park changjoon-park commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Clears four of the five ShellCheck findings reported in #7653.

Scope

The fifth finding (upgrade-pylib.lock.yml:511) is in a gh-aw-generated file marked "DO NOT EDIT" whose source .md doesn't contain the flagged pattern — the `cat << EOF >> "$GH_AW_PROMPT"` sequence is injected by gh-aw's compile step for prompt assembly, not user-controlled workflow code. Per discussion on the issue, it will resolve via the in-flight gh-aw version bump in #7650.

Changes

lib-deps-check.yaml

SC2076 — replace `=~ " $module "` (quoted regex interpreted literally) with `== " $module "` glob match. Same intent (literal substring check), same semantics across both regex and glob metacharacters.

SC2086 — quote `$GITHUB_OUTPUT` in the output redirect.

update-doc-db.yml

SC2129 — collapse the eight sequential `echo ... >> $OUTPUT_FILE` lines (plus one `cat ... >> $OUTPUT_FILE`) into a single grouped redirect `{ ...; } > "$OUTPUT_FILE"`. Drops the now-redundant `echo -n '' > $OUTPUT_FILE` truncate (the grouped `>` handles truncation).

SC2016 — add `# shellcheck disable=SC2016` above the block; the backticks in the auto-generated-header comment are literal Markdown for the output .rs file, not command substitution.

Verification

Both modified blocks produce no ShellCheck output with shellcheck 0.11.0.

Semantic equivalence of the lib-deps-check `=~` → glob change was probed across six test inputs including regex metacharacters and glob-meaningful characters — outputs identical to the prior behavior in every case.

Closes #7653 (scoped to findings 1-4, per maintainer discussion above).

Summary by CodeRabbit

  • Chores
    • Enhanced internal workflow processes for improved robustness and reliability in build operations, including optimized module detection and output generation handling in continuous integration systems.

Clear four of the five ShellCheck findings reported in RustPython#7653. The
fifth finding is in upgrade-pylib.lock.yml — a gh-aw-generated file
marked "DO NOT EDIT" whose source .md does not contain the flagged
pattern — and is out of scope here; it will resolve via the in-flight
gh-aw version bump (RustPython#7650).

lib-deps-check.yaml:
  * SC2076: replace `=~ " $module "` (quoted regex interpreted
    literally) with `== *" $module "*` glob match. Same intent
    (literal substring), same semantics across regex metachars.
  * SC2086: quote `$GITHUB_OUTPUT` in the output redirect.

update-doc-db.yml:
  * SC2129: collapse the eight sequential `echo ... >> $OUTPUT_FILE`
    lines (plus one `cat ... >> $OUTPUT_FILE`) into a single grouped
    redirect `{ ...; } > "$OUTPUT_FILE"`. Drops the now-redundant
    `echo -n '' > $OUTPUT_FILE` truncate.
  * SC2016: add `# shellcheck disable=SC2016` above the block; the
    backticks in the auto-generated-header comment are literal
    Markdown, not command substitution.

Verified locally with shellcheck 0.11.0: both modified blocks
produce no ShellCheck output. Semantic equivalence of the
lib-deps-check change confirmed across six test inputs including
regex metachars and glob-meaningful characters.
@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 24efbf35-ee12-4269-82fc-ab96fa4b0cc3

📥 Commits

Reviewing files that changed from the base of the PR and between dc0c814 and 71e5fbb.

📒 Files selected for processing (2)
  • .github/workflows/lib-deps-check.yaml
  • .github/workflows/update-doc-db.yml

📝 Walkthrough

Walkthrough

This pull request addresses ShellCheck warnings in GitHub Actions workflows by refactoring shell script patterns. Changes include switching module detection from regex-based to wildcard-based matching, consolidating multiple echo statements into grouped redirects, and properly quoting variable references to improve script robustness.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow ShellCheck Fixes
.github/workflows/lib-deps-check.yaml, .github/workflows/update-doc-db.yml
lib-deps-check.yaml: Replaced regex matching (=~) with shell wildcard substring matching for module detection; added quotes around $GITHUB_OUTPUT reference. update-doc-db.yml: Consolidated multiple echo >> $OUTPUT_FILE calls into a single grouped shell block with quoted output path and added shellcheck directive suppression.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 These scripts now hop with cleaner ways,
No ShellCheck warnings cloud our days,
With wildcards swift and groupings tight,
The workflows shine, all polished bright! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: fixing ShellCheck findings in two specific workflow files.
Linked Issues check ✅ Passed The PR addresses findings 1-4 from issue #7653 in lib-deps-check.yaml and update-doc-db.yml, with changes validated against ShellCheck 0.11.0.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the ShellCheck findings in the two targeted workflow files as specified in the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ShaharNaveh ShaharNaveh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty:)

@changjoon-park

changjoon-park commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

ty:)

Thanks for checking :)

@fanninpm

Copy link
Copy Markdown
Contributor

@youknowone the fifth ShellCheck alert is in a file you generated. Please regenerate .github/workflows/upgrade-pylib.lock.yml using an updated version of the tool you used, and please commit the result to the repository as you see fit.

Comment on lines +90 to +91
# shellcheck disable=SC2016
{

@fanninpm fanninpm Apr 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have meant this:

Suggested change
# shellcheck disable=SC2016
{
{
# shellcheck disable=SC2016

...but if it works, it works. ¯\_(ツ)_/¯

@youknowone

Copy link
Copy Markdown
Member

gh-aw is the generator

@youknowone
youknowone merged commit 1ab76d0 into RustPython:main Apr 24, 2026
20 checks passed
@changjoon-park
changjoon-park deleted the fix-shellcheck-workflows branch April 27, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix ShellCheck Errors in GitHub Actions Workflows

4 participants