Skip to content

chore: add shellcheck and shfmt for scripts#520

Open
vprashar2929 wants to merge 2 commits intoopenshift:mainfrom
vprashar2929:chore-shell
Open

chore: add shellcheck and shfmt for scripts#520
vprashar2929 wants to merge 2 commits intoopenshift:mainfrom
vprashar2929:chore-shell

Conversation

@vprashar2929
Copy link
Contributor

This commit adds support for running shellcheck and shfmt on the must-gather scripts.

Changes include:

  • Add lint and fmt targets to Makefile for running shellcheck and shfmt
  • Add hack/tools.sh script to install shellcheck and shfmt binaries
  • Add hack/utils.bash with helper functions for tool installation
  • Fix shellcheck warnings in common.sh:
    • Remove useless echo in variable assignments (SC2116)
    • Add shellcheck disable for variables used by sourcing scripts (SC2034)
    • Add shellcheck disable for sed commands (SC2001)
  • Reformat common.sh and monitoring_common.sh with shfmt
  • Add /tmp to .gitignore for local tool binaries

This commit adds support for running shellcheck and shfmt on the must-gather scripts.

Changes include:

- Add lint and fmt targets to Makefile for running shellcheck and shfmt
- Add hack/tools.sh script to install shellcheck and shfmt binaries
- Add hack/utils.bash with helper functions for tool installation
- Fix shellcheck warnings in common.sh:
  - Remove useless echo in variable assignments (SC2116)
  - Add shellcheck disable for variables used by sourcing scripts (SC2034)
  - Add shellcheck disable for sed commands (SC2001)
- Reformat common.sh and monitoring_common.sh with shfmt
- Add /tmp to .gitignore for local tool binaries

Signed-off-by: vprashar2929 <vibhu.sharma2929@gmail.com>
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 26, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 26, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vprashar2929
Once this PR has been reviewed and has the lgtm label, please assign sferich888 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vprashar2929
Copy link
Contributor Author

@vprashar2929 vprashar2929 marked this pull request as ready for review January 26, 2026 15:24
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 26, 2026
@ingvagabund
Copy link
Member

ingvagabund commented Jan 27, 2026

@vprashar2929 this looks great. It's an important start. +1 for adding the tooling here.

Before it's ok to start updating (even just formatting) the scripts I'd like to first spend some time producing unit tests. So we can reduce a risk of regressions or accidentally changing a code that can lose it's ability to be understood by the original author.

get_operator_ns() looks like the first good candidate.

@vprashar2929
Copy link
Contributor Author

I agree and I am happy to hold this off until I add tests to ensure that all must gather scripts are validated against cluster and provide the expected results

Signed-off-by: vprashar2929 <vibhu.sharma2929@gmail.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 11, 2026

@vprashar2929: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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.

2 participants