* 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
49 lines
1.7 KiB
Bash
49 lines
1.7 KiB
Bash
# shellcheck shell=bash
|
|
|
|
__dart_completion() {
|
|
# shellcheck disable=SC2155
|
|
local prev=$(_get_pword)
|
|
# shellcheck disable=SC2155
|
|
local curr=$(_get_cword)
|
|
|
|
local HELP="--help -h"
|
|
local VERBOSE="-v --verbose"
|
|
|
|
case $prev in
|
|
analyze)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "$HELP --fatal-infos --no-fatal-warnings --fatal-warnings" -- "$curr"))
|
|
;;
|
|
compile)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "$HELP aot-snapshot exe js jit-snapshot kernel" -- "$curr"))
|
|
;;
|
|
create)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "$HELP --template -t --no-pub --pub --force" -- "$curr"))
|
|
;;
|
|
-t | --template)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "console-simple console-full package-simple web-simple" -- "$curr"))
|
|
;;
|
|
format)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "$HELP $VERBOSE -o --output --fix -l --line-length" -- "$curr"))
|
|
;;
|
|
pub)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "$HELP $VERBOSE --version --no-trace --trace --verbosity cache deps downgrade get global logout outdated publish run upgrade uploader version" -- "$curr"))
|
|
;;
|
|
run)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "$HELP --observe --enable-vm-service --no-pause-isolates-on-exit --no-pause-isolates-on-unhandled-exceptions --no-warn-on-pause-with-no-debugger --pause-isolates-on-exit --pause-isolates-on-unhandled-exceptions --warn-on-pause-with-no-debugger" -- "$curr"))
|
|
;;
|
|
dart)
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "$HELP $VERBOSE --version --enable-analytics --disable-analytics help analyze compile create format pub run test" -- "$curr"))
|
|
;;
|
|
esac
|
|
}
|
|
|
|
complete -F __dart_completion dart
|