Lint: prepare lib/utilities for shellcheck#1933
Merged
NoahGorny merged 13 commits intoBash-it:masterfrom Sep 28, 2021
Merged
Conversation
This was referenced Sep 9, 2021
8cf2192 to
c2d0a0c
Compare
545932f to
fa017bf
Compare
e61622e to
a891206
Compare
lib/utilities for shellchecklib/utilities for shellcheck
a891206 to
629ab96
Compare
Contributor
Author
|
@cornfeedhobo another PR if you're looking for something to read 😆 |
3f40cb4 to
9bb19f7
Compare
6 tasks
Member
|
I like this, this requires a rebase, but looks great overall. You can also add some tests to |
9bb19f7 to
df1b8e1
Compare
Contributor
Author
|
Rebased to current master and all tests pass, including |
NoahGorny
approved these changes
Sep 20, 2021
Member
NoahGorny
left a comment
There was a problem hiding this comment.
Great work @gaelicWizard!
Looking forward for a bats PR 😄
bc700d4 to
3adb998
Compare
SC2059
Account for plugins with names that contain periods.
Use fewer subprocesses and newline-delimited not space-delimited.
Use fewer subprocesses and return newline-delimited, not space-delimited.
Use `sort -u` instead of `sort | uniq`
Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`
Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`
1. Executing `'/usr/bin/grep'` does *not* return the path to grep... 2. use `type -p` instead of external binary `which`. 3. Simplify parameter definition. 4. Why was there a space after `%s`?
Alsö, lose a spurious `cat`
My apologies to future `git blame` hunters ♥
Use `${BASH_IT_LOAD_PRIORITY_SEPARATOR}`
3adb998 to
1f2d3f4
Compare
NoahGorny
reviewed
Sep 28, 2021
| # filename without path | ||
| filename="${1##*/}" | ||
| # filename without path or priority | ||
| filename="${filename##*${BASH_IT_LOAD_PRIORITY_SEPARATOR?}}" |
Member
There was a problem hiding this comment.
seems like this generates SC2295 warning, somehow this slipped here @gaelicWizard
Contributor
Author
There was a problem hiding this comment.
Go figure! I've got a few tiny changes to utilities pending, so I'll throw that in there.
ira-at-work
pushed a commit
to seefood/bash-it
that referenced
this pull request
Oct 10, 2021
* master: (113 commits) skip go tests when go is not available plugins: Add ble.sh plugin clean up pyenv plugin Lint: prepare `lib/utilities` for `shellcheck` (Bash-it#1933) plugin/base: improvements (Bash-it#1930) plugins/percol: `bind` completion/git: `shfmt` && `shellcheck` completion/git: expand search range plugin/percol: `shellcheck` & `shfmt` plugins/percol: use `_command_exists` completion/pip: simplify code flow plugin/less-pretty-cat: remove `|| cat` completion/wpscan: simplify code flow (whitespace) plugins/less-pretty-cat: simplify code flow plugins/less-pretty-cat: use `_command_exists` lib/helpers: cite `_bash-it-find-in-ancestor()` gradle: adopt `_bash_it_find_in_ancestor()` lib/helpers: new function `_bash-it-find-in-ancestor()` completion/laravel: simplify code flow plugin/ruby: add missing parameter error message ...
ira-at-work
pushed a commit
to seefood/bash-it
that referenced
this pull request
Oct 10, 2021
* master: (113 commits) skip go tests when go is not available plugins: Add ble.sh plugin clean up pyenv plugin Lint: prepare `lib/utilities` for `shellcheck` (Bash-it#1933) plugin/base: improvements (Bash-it#1930) plugins/percol: `bind` completion/git: `shfmt` && `shellcheck` completion/git: expand search range plugin/percol: `shellcheck` & `shfmt` plugins/percol: use `_command_exists` completion/pip: simplify code flow plugin/less-pretty-cat: remove `|| cat` completion/wpscan: simplify code flow (whitespace) plugins/less-pretty-cat: simplify code flow plugins/less-pretty-cat: use `_command_exists` lib/helpers: cite `_bash-it-find-in-ancestor()` gradle: adopt `_bash_it_find_in_ancestor()` lib/helpers: new function `_bash-it-find-in-ancestor()` completion/laravel: simplify code flow plugin/ruby: add missing parameter error message ...
ira-at-work
pushed a commit
to seefood/bash-it
that referenced
this pull request
Oct 11, 2021
…autosave-history-plml * 'master' of https://github.com/bash-it/bash-it: (114 commits) ci: Bump go to 1.17 from 1.14 skip go tests when go is not available plugins: Add ble.sh plugin clean up pyenv plugin Lint: prepare `lib/utilities` for `shellcheck` (Bash-it#1933) plugin/base: improvements (Bash-it#1930) plugins/percol: `bind` completion/git: `shfmt` && `shellcheck` completion/git: expand search range plugin/percol: `shellcheck` & `shfmt` plugins/percol: use `_command_exists` completion/pip: simplify code flow plugin/less-pretty-cat: remove `|| cat` completion/wpscan: simplify code flow (whitespace) plugins/less-pretty-cat: simplify code flow plugins/less-pretty-cat: use `_command_exists` lib/helpers: cite `_bash-it-find-in-ancestor()` gradle: adopt `_bash_it_find_in_ancestor()` lib/helpers: new function `_bash-it-find-in-ancestor()` completion/laravel: simplify code flow ...
catull
pushed a commit
to catull/bash-it
that referenced
this pull request
Oct 21, 2021
* lib/utilities: shellcheck
SC2059
* lib/utilities: fix `_bash-it-get-component-type-from-path()`
Account for plugins with names that contain periods.
* lib/utilities: fix `_bash-it-array-dedup()`
Use fewer subprocesses and newline-delimited not space-delimited.
* lib/utilities: fix `_bash-it-component-list()`
Use fewer subprocesses and return newline-delimited, not space-delimited.
* lib/utilities: fix `_bash-it-component-list-matching()`
Use `sort -u` instead of `sort | uniq`
* lib/utilities: fix `_bash-it-component-list-enabled()`
Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`
* lib/utilities: fix `_bash-it-component-list-disabled()`
Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`
* lib/utilities: fix `_bash-it-grep()`
1. Executing `'/usr/bin/grep'` does *not* return the path to grep...
2. use `type -p` instead of external binary `which`.
3. Simplify parameter definition.
4. Why was there a space after `%s`?
* lib/utilities: use `_bash-it-grep`
Alsö, lose a spurious `cat`
* lib/utilities: lint `_bash-it-component-help`
* lib/utilities: lint `_bash-it-component-cache-file()`
* lib/utilities: `shfmt`
My apologies to future `git blame` hunters ♥
* lib/helpers: fix `_bash-it-get-component-name-from-path()`
Use `${BASH_IT_LOAD_PRIORITY_SEPARATOR}`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a partial PR covering only the
lib/utilitiesportion of #1917 in support of #1696.Motivation and Context
My
shellcheckbranch (#1917) got a bit large, so I'm splitting it up. Each change is split out in to its own commit, so it should be easy to review that way. There are no intended behavior changes whatsoever; this is almost entirely quoting things, plus a few improvements to functions.How Has This Been Tested?
The full test suite and
shellcheckhave run on #1917 and this is part of my main branch.Types of changes
Checklist:
clean_files.txtand formatted it usinglint_clean_files.sh.