Commit Graph

407 Commits (2fe9e0105159ab96a2286c2f073d829e85ef2f15)

Author SHA1 Message Date
Noah Gorny 2e968c459c
Merge pull request #1989 from tsiflimagas/bashit-completions-performance
Bash-it completions performance improvement
2022-01-07 08:55:46 +02:00
Noah Gorny c81c9dcc8c
Merge pull request #1865 from NoahGorny/add-profile-subcommand
add profile subcommand
2022-01-03 14:00:39 +02:00
Noah Gorny 2e51e92699
Merge pull request #2000 from gaelicWizard/lint
Revert most of "Fix linting errors that snuck in."
2022-01-01 23:01:09 +02:00
Kostas Giapis 45e8c4e3cd Handle `restart` completions 2021-12-30 17:03:23 +02:00
Kostas Giapis 2a2cc72541 Make parameter truncation greedy 2021-12-30 17:01:22 +02:00
John D Pell 64f75ce22d Revert most of "Fix linting errors that snuck in."
This reverts commit 2c8ee40566.

- _Shellcheck_ documentation for the [`source-path`]( https://github.com/koalaman/shellcheck/wiki/Directive#source-path ) directive indicates this is correct usage. We're `source`ing the `bash-preexec.sh` file from inside the `vendor/github.com/rcaloras/bash-preexec` directory. If we used the [`source`]( https://github.com/koalaman/shellcheck/wiki/Directive#source ) directive, then the full complete path to the file itself would need to be specified.
- Fix `disable=1090` to `disable=SC1090` and remove duplicate lines since this `shellcheck` directive will apply to the entire if-ladder.
- Disabling `SC2154` is almost never appropriate. In this case, several `_git_bash_completion*` variables are expressly assigned in this file, so there is no "unknown" to ignore.

Aside: the `${!_git_bash_completion@}` construct will expand to all variables starting with the previx `_git_bash_completion`, so this line is just a shorthand way to clear all our variables concisely without forgetting any.
2021-12-27 16:18:20 -08:00
John D Pell 6a41dbc3f6 Add "bash-progcomp" from "https://github.com/gaelicWizard/bash-progcomp@v2.0.1"
git-vendor-name: bash-progcomp
git-vendor-dir: vendor/github.com/gaelicWizard/bash-progcomp
git-vendor-repository: https://github.com/gaelicWizard/bash-progcomp
git-vendor-ref: v2.0.1
2021-12-27 11:36:38 -08:00
John D Pell fdb50aec6b Remove defaults completion v1 2021-12-27 11:36:38 -08:00
Novite5 1065d98dbe
"pipenv --completion" is obsoleted
Reference: https://buildmedia.readthedocs.org/media/pdf/pipenv/latest/pipenv.pdf 4.2.18 Shell Completion
2021-12-12 18:11:21 +08:00
Kostas Giapis 476159eab9 Use bash features as much as possible 2021-12-11 17:48:33 +02:00
Kostas Giapis 15fe122c1f Make more variables local 2021-12-03 06:31:28 +02:00
Kostas Giapis 4d821338a3 Double quote some variables 2021-12-03 06:31:28 +02:00
Kostas Giapis 9c4f7773b9 Improve performance for the rest of bash-it completions 2021-12-03 06:31:16 +02:00
Kostas Giapis 5b29d3c6e6 Improve performance of 'bash-it enable' completions 2021-12-03 06:29:39 +02:00
cornfeedhobo 2c8ee40566
Fix linting errors that snuck in. 2021-12-02 09:14:01 -06:00
Noah Gorny cf08fcaff2
Merge pull request #1965 from gaelicWizard/completion-git
completion/git: improvements and linting
2021-10-07 00:10:47 +03:00
Noah Gorny 7fc003b7d6 completion: Add completion for bash-it profile rm/list 2021-09-29 00:30:24 +03:00
Noah Gorny eaa2f829bd completion: Add bash-it profile subcommand 2021-09-29 00:30:23 +03:00
Noah Gorny 7fb7bb9cb8
Merge pull request #1952 from gaelicWizard/uncle
lib/helpers: new function `_bash-it-find-in-ancestor()`
2021-09-28 16:51:30 +03:00
Noah Gorny 8a1dc96bc0
Merge pull request #1964 from gaelicWizard/completion-pip
completion/pip: simplify control flow
2021-09-28 15:14:58 +03:00
Noah Gorny 002a23c758
Merge pull request #1961 from gaelicWizard/completion-wpscan
completion/wpscan: simplify code flow (whitespace)
2021-09-28 15:02:25 +03:00
John D Pell b0750fa49f completion/git: `shfmt` && `shellcheck` 2021-09-24 21:11:28 -07:00
John D Pell e22aac855e completion/git: expand search range
- Remove limitation on OS.
- Add search for Mac OS X developer tools locations by using `xcrun` instead of trying to guess paths.
- Add search for locations based on path of `$GIT_EXE` (set by `lib/theme`).
2021-09-24 21:10:01 -07:00
John D Pell b897c7d3ce completion/pip: simplify code flow
Short-circuit the loader rather than indenting nearly the whole file.

ALSÖ, assign the `_pip_completion()` handler directly once it's loaded so that we get out of the way once we load it.
2021-09-23 22:21:02 -07:00
John D Pell 84c96665ce completion/wpscan: simplify code flow (whitespace)
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.
2021-09-23 14:51:21 -07:00
John D Pell 7ed12083f2 gradle: adopt `_bash_it_find_in_ancestor()` 2021-09-22 15:30:07 -07:00
John D Pell be90e655f1 completion/laravel: simplify code flow
And apply `shfmt` and fix `shellcheck`
2021-09-22 13:48:10 -07:00
Noah Gorny 8c697715eb
Merge pull request #1938 from gaelicWizard/_command_exists
Use `_command_exists` everywhere
2021-09-20 14:56:45 +03:00
Noah Gorny 4700d7bf05
Merge pull request #1935 from gaelicWizard/next
Remove Executable Bit
2021-09-20 14:49:46 +03:00
Noah Gorny 4984d7adc8
Merge pull request #1834 from NoahGorny/lazily-load-pip
completion: pip: Only invoke pip when trying to complete it
2021-09-20 14:47:41 +03:00
John D Pell fb6e05d915 completions/sqlmap: use `_command_exists`
Addresses bash-it/bash-it#1632
2021-09-19 21:58:48 -07:00
John D Pell 8e9438d715 completion/hub: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 699720fe8b completion/docker-compose: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 679d8b10b6 completion/gradle: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 699d893bef completion/awscli: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell dca96e0c39 completion/consul: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell bb555aefbf completion/pew: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell ef0c64322f completion/travis: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell c29eb16dfc completion/git_flow: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 5eccc59d27 completion/git_flow_avh: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 8e169388d2 completions/laravel: use `_command_exists`
Addresses bash-it/bash-it#1632
2021-09-19 21:58:48 -07:00
John D Pell e2915df1e5 completions/wpscan: use `_command_exists`
Addresses bash-it/bash-it#1632
2021-09-19 21:58:48 -07:00
John D Pell a375e7131e Remove executable bit 2021-09-18 22:26:27 -07:00
John D Pell 5fc418e479 Use `${PWD}` instead of `$(pwd)`
Don't subshell when there's a shell parameter for it.
2021-09-18 13:15:13 -07:00
John D Pell 1f6d6aa147 Use `$PWD` instead of `\`pwd\``
Don't subshell when there's a shell parameter for it.
2021-09-18 13:14:52 -07: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
John D Pell feacd560b6 completion/system: update wording on shell version 2021-09-05 15:43:05 -07:00
John D Pell ecfcaba32e completion/system: accomodate multiple versions
For Homebrew, switch between v1 and v2 of bash-completion based on whether the running Bash shell is new enough to use v2.
2021-09-05 15:43:05 -07:00
John D Pell 0c412442f5 completion/system: give up hope
Give up and accept defeat that bash-completion can't reasonably be audited for unbound parameters. Wrap invocation with disabling strictness, and restore after if it was enabled.
2021-08-26 14:11:41 -07:00
John D Pell 65ef8e2e8b Use _bash_it_homebrew_check() in plugins, completions
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.
2021-08-22 12:48:48 -07:00