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

Update test '-a' and '-o' to '&&' and '||' #206

Closed
wants to merge 1 commit into from

Conversation

wileyhy
Copy link
Contributor

@wileyhy wileyhy commented Apr 29, 2023

lines 50, 103: in two compound ['s, replace '-a' with '] && ['
SC2166 – Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
SC2107 – Instead of [ a && b ], use [ a ] && [ b ].

line 45: in a compound test command, change '-o' to '|| test'
SC1139 – Use || instead of -o between test commands.
SC2109 – Instead of [ a || b ], use [ a ] || [ b ].

https://www.shellcheck.net/wiki/SC[0-9]{4}

lines 50, 103: in two compound ['s, replace '-a' with '] && ['
  SC2166 – Prefer `[ p ] && [ q ]` as `[ p -a q ]` is not well defined. 
  SC2107 – Instead of `[ a && b ]`, use `[ a ] && [ b ]`.

line 45: in a compound test command, change '-o' to '|| test'
  SC1139 – Use `||` instead of `-o` between test commands.
  SC2109 – Instead of `[ a || b ]`, use `[ a ] || [ b ]`.

https://www.shellcheck.net/wiki/SC[0-9]{4}
@perexg perexg closed this in 4588b2f May 3, 2023
wileyhy added a commit to wileyhy/alsa-utils that referenced this pull request May 5, 2023
lines 50, 103: in two compound ['s, replace '-a' with '] && ['
  SC2166 – Prefer `[ p ] && [ q ]` as `[ p -a q ]` is not well defined.
  SC2107 – Instead of `[ a && b ]`, use `[ a ] && [ b ]`.

line 45: in a compound test command, change '-o' to '|| test'
  SC1139 – Use `||` instead of `-o` between test commands.
  SC2109 – Instead of `[ a || b ]`, use `[ a ] || [ b ]`.

 ... https://github.com/koalaman/shellcheck

Fixes: alsa-project#206
From: wileyhy @ github
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

///
Performed manual edit during rebase:
  1. Altered some quotation marks
  2. replace '-a' with '] && ['
///
wileyhy added a commit to wileyhy/alsa-utils that referenced this pull request May 5, 2023
Added double quotes to common expansions; removed quotes from strings; changed REQUIRES to an indexed array and changed the corresponding for loop; added curly braces where feasibly necessary; removed a few unnecessary trailing semi-colons; and put URL's in single quotes to prevent any possible expansions, except for within the sed command. Some logic structures depend on word splitting, so I left those as-is for this commit. Double exclamation marks in double quotes allow history expansion which is usually disabled in non-interactive shells, so I left those as-is also.

Merging of pull requests alsa-project#206 and alsa-project#207 altered the master branch, so I
did a manual edit this pull request during rebase.

///
Manual edit during rebase:
  1. line ~50, repeat "replace '-a' with '] && ['"
///
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.

None yet

1 participant