This commit cleans up the pyenv plugin to follow the newer conventions of the
other *env plugins, as well as addresses the changes made to pyenv for PATH
munging.
* plugins/base: code style improvements
Quote variables, use $@ and $array[@] instead of $*, typeset some integers, remove unneccesasary binary invocation, use shell features when possible, remove `eval`, &c.
* plugins/base: conditional function definitions
Instead of functions failing when required tools aren't installed, just don't define the function.
Alsö, don't redefine del() if it already exists.
* plugins/base: rewrite `usage()`
Reimplement disk usage function using Bash syntax and simpler layout, without having to invoke an external binary.
* plugins/base: revamp `quiet()`
New implementation that is even quieter.
* plugins/base: `myip()`
* plugins/base: `pickfrom()`
* plugins/base: `passgen()`
Fix `passgen()` to not need `tr`, remove one subshell, and eliminate a useless `echo`.
* plugins/base: `mkcd()`
* plugins/base: `mkiso()`
* plugins/base: remove `banish-cookies()`
Adobe Flash is gone with the wind. Alsö, this would be something someone would do *once* and shouldn't be a function...
* plugins/base: `lsgrep` is SC2010
The `lsgrep()` function is *itself* explicitly forbidden by `shellcheck` rule SC2010.
Alsö, s/`$*`/`$@`
* plugins/base: `mkiso()`
Expressly handle unbound parameters.
* plugins/base: remove `command_exists`
* plugin/base: lint SC2154 && SC2144
Newly undisabled `shellcheck` rules
* plugin/base: import libs for tests
* plugin/base: `shfmt`
Apply `shfmt` using current project settings. My apologies to future `git blame` hunters. ♥
Addresses bash-it/bash-it#1632
And use `_log_warning`.
Alsö, code style cleanup: quote things, handle unbound parameters, &c.
Alsö alsö, short-circuit if not installed or inadequate _Bash_ version.
Convert from indented if-block to return then unindented code. This should have basically one line change at the top, one line removed at the bottom, and then all whitespace.
* 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
Convert `var=${dirname $filename)` to `var="${filename%/*}` in cases where there is no ambiguity.
Make sure that the path in `$BASH_IT` is absolute because this path gets embedded in the template `.bash_profile` file if selected by the user.
Use new function `_bash_it_homebrew_check()` in existing plugins and completions which look for Homebrew.
Alsö, use `$OSTYPE` instead of calling external `uname` binary.
* lib/helpers: use `$OSTYPE` instead of `$(uname)`
* plugins/osx: use `$OSTYPE` instead of `$(uname)`
* plugins/boot2docker: use `$OSTYPE` instead of `$(uname)`
* plugins/python: use `$OSTYPE` instead of `$(uname)`
* plugins/base: use `$OSTYPE` instead of `$(uname)`
Alsö, use `[[` instead of `[` as the former has less insane argument handling being shell syntax rather than a builtin command that must emulate being a real binary
* completion/brew: use `$OSTYPE` instead of `$(uname)`
* completion/git: use `$OSTYPE` instead of `$(uname)`
Alsö, use `[[` instead of `[`.
* completion/fabric: use `$OSTYPE` instead of `uname`
* theme/demula: use `$OSTYPE` instead of `$(uname)`
* theme/rana: use `$OSTYPE` instead of `$(uname)`