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

Resolving Shellcheck SD2086 and SC2046 #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JonTheNiceGuy
Copy link

@JonTheNiceGuy JonTheNiceGuy commented Jan 19, 2021

Shellcheck results SC2046 and SC2086 relate to how variables are handled where they may hold strings with spaces or "glob"ing characters (like * and ?).

In this PR, I wrap all script or function calls which pass variables that are themselves variables ($foo), or commands ($(foo)).

Note that this broke the test for generate-contents-with-prefix, so I resolved that by changing getopt $* to getopts in src/_adr_generate_toc.

This also removes the unnecesary loading of the config file in _adr_dir.

Shellcheck results [SC2046](https://www.shellcheck.net/wiki/SC2046) and
[SC2086](https://www.shellcheck.net/wiki/SC2086) relate to how variables are
handled where they may hold strings with spaces or "glob"ing characters (like
`*` and `?`).

In this PR, I wrap all script or function calls which pass variables that are
themselves variables (`$foo`), or commands (`$(foo)`).

Note that this broke the test for generate-contents-with-prefix, so I resolved
that by changing `getopt $*` to `getopts` in `src/_adr_generate_toc`.
halostatue pushed a commit to halostatue/adr-tools that referenced this pull request Jul 20, 2024
Shellcheck results [SC2046](https://www.shellcheck.net/wiki/SC2046) and
[SC2086](https://www.shellcheck.net/wiki/SC2086) relate to how variables are
handled where they may hold strings with spaces or "glob"ing characters (like
`*` and `?`).

In this PR, I wrap all script or function calls which pass variables that are
themselves variables (`$foo`), or commands (`$(foo)`).

Note that this broke the test for generate-contents-with-prefix, so I resolved
that by changing `getopt $*` to `getopts` in `src/_adr_generate_toc`.

- Removed non-required loading of config in _adr_dir

npryce#104
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.

1 participant