Skip to content
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

Apply shellcheck fixes #14

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Apply shellcheck fixes #14

merged 1 commit into from
Apr 17, 2024

Conversation

nwiltsie
Copy link
Member

@nwiltsie nwiltsie commented Oct 7, 2023

Shellcheck is a tool for finding problematic code in shell scripts, from syntax errors to subtle and non-intuitive pitfalls. It is also capable of automatically fixed some kinds of issues.

Eventually shellcheck will be enabled in the CI/CD checks (i.e. the linters) used by this repository. In order to ease that transition (and make your life easier!), this PR includes all code fixes that could be performed automatically.

None of these fixes have been tested - this pull request was generated by a script and should be reviewed very closely.

These changes make the shell scripts in this repository abide by the following shellcheck rules:

There were also warnings that could not be fixed automatically:

In modify_reference_path.sh line 6:
cat "${refpath_default}" | \
    ^------------------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

For more information:
  https://www.shellcheck.net/wiki/SC2002 -- Useless cat. Consider 'cmd < file...

If any of these fixes/warnings are incorrect, shellcheck can be silenced by adding a line like #shellcheck disable=<rule name> immediately before the offending line (docs).

Also, you can just sidestep this issue completely by adding a .cicd-env file to the root of this repository with VALIDATE_SHELL="false" (reference). Please only do that as a last resort - linters are on your side!

Copy link
Contributor

@Faizal-Eeman Faizal-Eeman left a comment

Choose a reason for hiding this comment

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

Looks good!

@Faizal-Eeman Faizal-Eeman merged commit 219eb43 into main Apr 17, 2024
1 check passed
@Faizal-Eeman Faizal-Eeman deleted the nwiltsie_apply_shellcheck branch April 17, 2024 21:09
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