Commit Graph

13 Commits (135d480c7da93443e6ac1354e6554e76e70a233b)

Author SHA1 Message Date
John D Pell 26b402e254 lib/reloader: unset "${!_bash_it_reloader_@}" 2022-01-28 13:58:00 -08:00
John D Pell fd7b20b8d7 reloader: `shellcheck` && `shfmt`
Rewrite globbing per `shellcheck`'s SC2013 recommendations, and standardize whitespace.
2022-01-28 03:59:45 -08:00
John D Pell 75d22d865f lib/reloader: adopt `_bash-it-log-prefix-by-path()` 2022-01-28 03:59:45 -08:00
John D Pell 1c3cbf7ca6
Delete `.shellcheckrc` (#1947)
* CI: disable Ubuntu 16.04 as it's EOL

https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

* main: lint false positive

* install: lint

* plugins/cmd-returned-notify: don't `export`

* plugins/xterm: lint

* plugins/git: lint

* plugins/goenv: lint

* plugins/alias-completion: lint false positives

* plugins/alias-completion: fix SC2155, SC2154

Declare `locals` at the top of the function

* completion: lint completions using `bash_completion` functions

Match the style of the existing code

* completion/knife: lint false positives

* completion/knife: lint

* completion/sdkman: lint

* completion/composer: lint

* Move `.shellcheckrc` under `themes/`

* lib/theme: fix SC2155, SC2154, SC2034

* lib/colors: don't warn on unused variables

We assign a large number of variables here and they may or may not be used anywhere else, so disable SC2034 for this file (only).

Alsö disable SC2005 as the functions in this file were written before `printf` was invented and have to do some fancy metascripting to get escape sequences interpreted reliably. I’m not smart enough to fix this to use `printf`, so leave it for now.

* themes/agnoster: lint

* themes: disable SC2154 for colors

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* themes: disable SC2154, fix SC2155

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* Delete `.shellcheckrc`

* remove executable bit
2021-09-18 12:50:59 +03:00
cornfeedhobo 8fcf713541
use absolute paths instead of changing directory 2021-01-31 15:32:23 -06:00
Terminal for Life 921ea9ac76
Optimizations to reloader.bash (#1749)
* Optimized statement with REGEX by using `case`

REGEX is a great feature of BASH, but in this case it was energy
needlessly spent. A `case` statement suffices. Bring in REGEX when
you're going to make good use of it, otherwise it's just going to bog
down your code.

I also wanted to strip the ` || exit 1` on the last line, but I wasn't
sure if this file is meant to be sourced or not; if not, then exiting
like that is redundant because it will already exit with whichever
status the last command provides, unless `popd` specifically offers
unhelpful or no exit statuses.

* Optimize as before but with 2nd REGEX instance

This time is much like the last commit, so I won't repeat, but I will
say that you're using a double- or even triple-negative, which
obfuscates your goal. Where you were doing...

[ ! -n VAR ] &&

You were basically saying this convolution:

If it's true that it's not true that VAR is not empty.

Very confusing. Instead, I've opted for:

If it's true that Var is empty.

Makes immediate sense and is easier to parse, visually speaking.
2020-12-27 17:14:50 +02:00
Noah Gorny 6a4142ced7 scripts: Add logs to reloader.bash 2020-06-30 20:58:09 +03:00
Travis Swicegood 2d6085b033 Switch from false to skip – I think that's more clear 2018-12-05 21:58:13 -06:00
Travis Swicegood 7b32dd6424 Add filtering to the $2 input in addition to $1 2018-12-05 21:54:59 -06:00
Travis Swicegood 5b8f8d874e Default to loading everything
The tests are failing because $1 is being passed through from the
initial loading. When this loads in the shell, $1 is empty though so
the code works-for-me, but just not the tests.

This filters the $1 input to ensure its one of the valid types
expected inside the ./enabled directory.
2018-12-05 21:53:39 -06:00
Travis Swicegood c76263dc47 Ensure this debugging output is generated (oops) 2018-12-05 21:04:55 -06:00
Travis Swicegood 992b87b816 Shellcheck clean up based on comments from @nwinkler 2018-12-05 21:00:59 -06:00
Travis Swicegood e5b68695c0 Attempt to simplify by not using aliases 2018-12-04 22:02:10 -06:00