-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add shellcheck
across RAPIDS
#135
Comments
shellcheck
across RAPIDS
Hey thanks for putting this up! I totally support it. But instead of invoking a separate GitHub action, I think we should do this via the repos:
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck I've been sprinkling that around some repos for the last couple months and have found it works great... lightweight to install, runs fast, exactly matches the behavior of other For example: Doing that via |
Sounds good to me -- do we also run |
Yep! By convention, every RAPIDS project uses a workflow called checks:
secrets: inherit
needs: telemetry-setup
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false
ignored_pr_jobs: "telemetry-summarize" Which looks for a script named Most repos then have content in that So that all happens by convention but you can generally safely assume that every RAPIDS repo is running |
I pushed up an example commit of what this might look like here for |
shellcheck is a fast, static analysis tool for shell scripts. It's good at flagging up unused variables, unintentional glob expansions, and other potential execution and security headaches that arise from the wonders of bash (and other shlangs). This PR adds a pre-commit hook to run shellcheck on all of the sh-lang files in the ci/ directory, and the changes requested by shellcheck to make the existing files pass the check. xref: rapidsai/build-planning#135 Authors: - Gil Forsyth (https://github.com/gforsyth) Approvers: - Bradley Dice (https://github.com/bdice) - Peter Andreas Entschev (https://github.com/pentschev) URL: #1427
Description
shellcheck
is a fast, static analysis tool for shell scripts. It's good atflagging up unused variables, unintentional glob expansions, and other potential
execution and security headaches that arise from the wonders of
bash
(and other shlangs).https://www.shellcheck.net/
Any shell script that is running in CI in a RAPIDS repo should be passing
shellcheck
.Benefits of this work
complete to be conflated with shell scripts that have executed correctly.
shell scripts in PRs, automating "linty" PR suggestions.
Notes
For the initial scope, I propose that we only run
shellcheck
on scripts in theci/
directory, or on any scripts that are called in GHA.There are some repos with a lot of shell-scripts more related to local
build-process, and these are less critical to "get right" (although that can be
done incrementally in the future).
Further, making several small tweaks to existing local build scripts across
these packages may break things in subtle ways, so it's better to have buy-in
from project maintainers before delving too deeply beyond
ci/
Acceptance Criteria
shellcheck
is run in CI against theci/
directory in all RAPIDS repos that have shell scriptsshellcheck
or have explicit (individual)exceptions noted. (No blanket exemptions)
Approach
These repos can be updated in any order, since these updates are all self-contained.
The goal is to have each repo running
shellcheck
in GHA, similar to https://github.com/rapidsai/gha-tools/blob/main/.github/workflows/prs.yaml#L20-L24Tasks
The text was updated successfully, but these errors were encountered: