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

Fix style issues #158

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Fix style issues #158

merged 1 commit into from
Jun 12, 2024

Conversation

samford
Copy link
Member

@samford samford commented Jun 12, 2024

While fixing brew style tap support (Homebrew/brew#17482), brew CI surfaced some style issues in this tap. This fixes style issues but there are still a number of shellcheck issues in handler.sh that need to be handled in some way (either through fixes or disabling unwanted rules):

In /opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh line 12:
if ! which brew >/dev/null; then return; fi
     ^---^ SC2230 (info): 'which' is non-standard. Use builtin 'command -v' instead.


In /opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh line 22:
  if test -z "${CONTINUOUS_INTEGRATION}" && test -n "${MC_SID}" -o ! -t 1
              ^-----------------------^ SC2154 (warning): CONTINUOUS_INTEGRATION is referenced but not assigned.
                                                     ^-------^ SC2154 (warning): MC_SID is referenced but not assigned.


In /opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh line 27:
    [[ -n "${ZSH_VERSION}" ]] && [[ "${ZSH_VERSION}" > "5.2" ]] &&
                                                       ^---^ SC2072 (error): Decimals are not supported. Either use integers only, or use bc or awk to compare.


In /opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh line 34:
    local txt="$(brew which-formula --explain "${cmd}" 2>/dev/null)"
          ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values.


In /opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh line 43:
    [[ -n "${ZSH_VERSION}" ]] && [[ "${ZSH_VERSION}" > "5.2" ]] &&
                                                       ^---^ SC2072 (error): Decimals are not supported. Either use integers only, or use bc or awk to compare.

For more information:
  https://www.shellcheck.net/wiki/SC2072 -- Decimals are not supported. Eithe...
  https://www.shellcheck.net/wiki/SC2154 -- CONTINUOUS_INTEGRATION is referen...
  https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...

While fixing `brew style` tap support, brew CI surfaced some style
issues in this tap. This fixes style issues but there are still a
number of shellcheck issues in `handler.sh` that need to be handled
in some way (either through fixes or disabling unwanted rules).
@MikeMcQuaid
Copy link
Member

Thanks again @samford!

@MikeMcQuaid MikeMcQuaid merged commit a7b85d2 into Homebrew:master Jun 12, 2024
1 check passed
@samford samford deleted the brew-style-fixes branch June 12, 2024 14:37
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

2 participants