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
This commit is contained in:
John D Pell
2021-09-18 02:50:59 -07:00
committed by GitHub
parent b48f3fd7d3
commit 1c3cbf7ca6
44 changed files with 183 additions and 126 deletions

View File

@@ -83,8 +83,8 @@ function _bash-it_check_for_backup() {
fi
echo -e "\033[0;33mBackup file already exists. Make sure to backup your .bashrc before running this installation.\033[0m" >&2
if ! [[ $overwrite_backup ]]; then
while ! [[ $silent ]]; do
if [[ -z "${overwrite_backup}" ]]; then
while [[ -z "${silent}" ]]; do
read -e -n 1 -r -p "Would you like to overwrite the existing backup? This will delete your existing backup file ($HOME/$BACKUP_FILE) [y/N] " RESP
case $RESP in
[yY])
@@ -100,9 +100,9 @@ function _bash-it_check_for_backup() {
esac
done
fi
if ! [[ $overwrite_backup ]]; then
if [[ -z "${overwrite_backup}" ]]; then
echo -e "\033[91mInstallation aborted. Please come back soon!\033[m"
if [[ $silent ]]; then
if [[ -n "${silent}" ]]; then
echo -e "\033[91mUse \"-f\" flag to force overwrite of backup.\033[m"
fi
exit 1
@@ -114,8 +114,8 @@ function _bash-it_check_for_backup() {
function _bash-it_modify_config_files() {
_bash-it_check_for_backup
if ! [[ $silent ]]; then
while ! [[ $append_to_config ]]; do
if [[ -z "${silent}" ]]; then
while [[ -z "${append_to_config}" ]]; do
read -e -n 1 -r -p "Would you like to keep your $CONFIG_FILE and append bash-it templates at the end? [y/N] " choice
case $choice in
[yY])
@@ -131,7 +131,7 @@ function _bash-it_modify_config_files() {
esac
done
fi
if [[ $append_to_config ]]; then
if [[ -n "${append_to_config}" ]]; then
# backup/append
_bash-it_backup_append
else
@@ -174,12 +174,12 @@ done
shift $((OPTIND - 1))
if [[ $silent ]] && [[ $interactive ]]; then
if [[ -n "${silent}" && -n "${interactive}" ]]; then
echo -e "\033[91mOptions --silent and --interactive are mutually exclusive. Please choose one or the other.\033[m"
exit 1
fi
if [[ $no_modify_config ]] && [[ $append_to_config ]]; then
if [[ -n "${no_modify_config}" && -n "${append_to_config}" ]]; then
echo -e "\033[91mOptions --no-modify-config and --append-to-config are mutually exclusive. Please choose one or the other.\033[m"
exit 1
fi
@@ -197,7 +197,7 @@ esac
BACKUP_FILE=$CONFIG_FILE.bak
echo "Installing bash-it"
if ! [[ $no_modify_config ]]; then
if [[ -z "${no_modify_config}" ]]; then
_bash-it_modify_config_files
fi
@@ -212,10 +212,10 @@ cite _about _param _example _group _author _version
# shellcheck source=./lib/helpers.bash
source "$BASH_IT/lib/helpers.bash"
if [[ $interactive ]] && ! [[ $silent ]]; then
if [[ -n $interactive && -z "${silent}" ]]; then
for type in "aliases" "plugins" "completion"; do
echo -e "\033[0;32mEnabling $type\033[0m"
_bash-it_load_some $type
echo -e "\033[0;32mEnabling ${type}\033[0m"
_bash-it_load_some "$type"
done
else
echo ""
@@ -230,7 +230,7 @@ fi
echo ""
echo -e "\033[0;32mInstallation finished successfully! Enjoy bash-it!\033[0m"
# shellcheck disable=SC2086
echo -e "\033[0;32mTo start using it, open a new tab or 'source "$HOME/$CONFIG_FILE"'.\033[0m"
echo -e "\033[0;32mTo start using it, open a new tab or 'source "~/$CONFIG_FILE"'.\033[0m"
echo ""
echo "To show the available aliases/completions/plugins, type one of the following:"
echo " bash-it show aliases"