Commit Graph

134 Commits

Author SHA1 Message Date
John D Pell
003b0ce802 lib/helpers: shfmt
My apologies to future `git blame` hunters ♥
2022-01-18 11:02:36 -08:00
Noah Gorny
973a1f9b40 Merge pull request #1958 from gaelicWizard/plugin-proxy
plugin/proxy: lint
2022-01-18 19:42:32 +02:00
John D Pell
b772e6ace7 lib/log: shellcheck && shfmt
Alsö, fix tests to load `lib/colors` instead of `lib/appearance`...wut

Alsö, `short-circuit _has_colors()`: If we already looked up colors, and we already have them, then don't run `tput` again.

My apologies to future `git blame` hunters ♥
2022-01-09 00:49:44 -08:00
John D Pell
6e480d7a8a plugin/proxy: shellcheck && shfmt
plugins/proxy: use `_command_exists()`

Alsö, quote variables, handle unbound parameters, &c.
2022-01-09 00:40:49 -08:00
Noah Gorny
f2bff34493 Merge pull request #2013 from gaelicWizard/completion/system
completion/system: load earlier than others
2022-01-09 01:13:23 +02:00
Noah Gorny
1fd601db7f Merge pull request #2007 from gaelicWizard/plugin-latex
Plugin/LaTeX: 2009 was thirteen years ago
2022-01-09 01:11:41 +02:00
Noah Gorny
21e7c1f00c Merge pull request #2011 from gaelicWizard/plugin-nginx
plugin/nginx: cleanup
2022-01-09 01:11:06 +02:00
Noah Gorny
af801cfadc Merge pull request #2014 from gaelicWizard/plugin/gif
plugin/GIF: use `type -p` and lint
2022-01-09 01:10:43 +02:00
John D Pell
079652e6e7 plugin/nginx: cleanup
Dont overwrite user-set variable, and quote path. Local some variables, `shellcheck`, `shfmt`
2022-01-08 08:44:05 -08:00
John D Pell
2fe9e01051 plugins/latex: 2009 was 12 years ago
Locate the currently installed edition, instead of transpoting us back to undergrad.
2022-01-08 08:43:32 -08:00
John D Pell
ce22710e00 plugin/gif: shfmt
My apologies to future `git blame` hunters ♥
2022-01-08 08:43:17 -08:00
John D Pell
5fab574bfd completion/system: shfmt
My apologies to future `git blame` hunters ♥
2022-01-08 08:33:16 -08:00
John D Pell
97ef5a8087 test/run: lint 2022-01-08 08:29:13 -08:00
John D Pell
da6b27166f tests: new file test_helper_libs.bash
For testing non-core files, just `load ../test_helper_libs` after `load ../test_helper` instead of trying to guess which libs must be loaded, in which order, for testing to succeed.

`_command_exists` spews log messages, so our test log is littered with `_log_debug not found`. This fixes that too.
2022-01-08 08:29:13 -08:00
Noah Gorny
931f27ee3e Merge pull request #2016 from gaelicWizard/plugin/python
plugin/python: OS detection & `shfmt`
2022-01-07 08:50:07 +02:00
Noah Gorny
2728f20354 Merge pull request #2012 from gaelicWizard/theme/essential
theme/essential: cleanup
2022-01-07 08:48:16 +02:00
Noah Gorny
c060eb46ea Merge pull request #2001 from gaelicWizard/plugin-dirs
Plugin/dirs: use `$XDG_STATE_HOME`
2022-01-07 08:42:24 +02:00
Noah Gorny
dba610cdc8 Merge pull request #2009 from gaelicWizard/plugin-man
Plugin/man: Add `R` to `$LESS`
2022-01-07 08:41:41 +02:00
Noah Gorny
5d68fca7e5 Merge pull request #2008 from gaelicWizard/plugin-osx
Plugin/OSX: cleanup
2022-01-07 08:41:17 +02:00
Noah Gorny
48a1ff7fb4 Merge pull request #2005 from gaelicWizard/plugin-todo
Plugin/todo: cleanup and simplify
2022-01-07 08:40:52 +02:00
John D Pell
d1b7166358 theme/essential: shfmt 2022-01-03 20:45:39 -08:00
John D Pell
29216c0fd4 plugin/python: shfmt
My apologies to future `git blame` hunters ♥
2022-01-01 23:00:48 -08:00
John D Pell
c030f2108b plugin/git-subrepo: shellcheck 2022-01-01 22:48:01 -08:00
John D Pell
02b57a83ef plugins/todo: lint
plugin/base: use `_bash-it-component-item-is-enabled()`
2022-01-01 17:50:55 -08:00
John D Pell
03653fc141 plugins/osx-timemachine: shellcheck && shfmt
Use bash functionality rather than external binaries. Alsö, if $SUDO_ASKPASS is set then pass -A to sudo.
2022-01-01 17:50:22 -08:00
John D Pell
75aabd5d20 plugin/osx: shellcheck && shfmt
plugins/osx: dead code removal

No need for gymnastics to determine if variable had been exported priort to modification. If it was, then it still is. See man bash(1).
2022-01-01 17:50:22 -08:00
John D Pell
290aab4efe plugins/man: Add "R" to $LESS
Otherwise, `-R` must be added on the command line or colors just won't be rendered and these variables will be ignored.
2022-01-01 17:49:45 -08:00
John D Pell
71b4f3c1bc plugin/dirs: shfmt && shellcheck 2022-01-01 17:49:15 -08:00
Noah Gorny
2dd4426a7c Merge branch 'master' into plugin-java 2022-01-01 22:53:18 +02:00
John D Pell
f03a89836e plugins/java: quote path && shfmt
Provides an error message if no file is specified.
2021-12-30 20:25:19 -08:00
John D Pell
e38eeefc5f plugin/jekyll: second shellcheck pass 2021-12-27 12:22:42 -08:00
cornfeedhobo
bdb5289660 Wholesale cleanup of all history plugins
- remove the use of redundant cite
- minor cleanups to history.plugin.bash
- set explicit load orders for history-search and history-substring-search
- add new plugin history-eternal
- replace superfluous trap for managing HISTTIMEFORMAT changes
2021-12-02 09:13:56 -06:00
Ajeet D'Souza
a89f2f8f13 plugin: add zoxide 2021-11-24 16:49:46 +05:30
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
c360f0c7c5 plugins: Add ble.sh plugin 2021-09-28 16:48:16 +03:00
John D Pell
3eed0f033f Lint: prepare lib/utilities for shellcheck (#1933)
* lib/utilities: shellcheck

SC2059

* lib/utilities: fix `_bash-it-get-component-type-from-path()`

Account for plugins with names that contain periods.

* lib/utilities: fix `_bash-it-array-dedup()`

Use fewer subprocesses and newline-delimited not space-delimited.

* lib/utilities: fix `_bash-it-component-list()`

Use fewer subprocesses and return newline-delimited, not space-delimited.

* lib/utilities: fix `_bash-it-component-list-matching()`

Use `sort -u` instead of `sort | uniq`

* lib/utilities: fix `_bash-it-component-list-enabled()`

Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`

* lib/utilities: fix `_bash-it-component-list-disabled()`

Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`

* lib/utilities: fix `_bash-it-grep()`

1. Executing `'/usr/bin/grep'` does *not* return the path to grep...
2. use `type -p` instead of external binary `which`.
3. Simplify parameter definition.
4. Why was there a space after `%s`?

* lib/utilities: use `_bash-it-grep`

Alsö, lose a spurious `cat`

* lib/utilities: lint `_bash-it-component-help`

* lib/utilities: lint `_bash-it-component-cache-file()`

* lib/utilities: `shfmt`

My apologies to future `git blame` hunters ♥

* lib/helpers: fix `_bash-it-get-component-name-from-path()`

Use `${BASH_IT_LOAD_PRIORITY_SEPARATOR}`
2021-09-28 15:24:18 +03:00
John D Pell
c2c76a380a plugin/base: improvements (#1930)
* 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. ♥
2021-09-28 15:13:27 +03:00
Noah Gorny
127cbbd4e3 Merge pull request #1957 from gaelicWizard/plugin-less-pretty-cat
plugin/less-pretty-cat improvements
2021-09-28 15:09:28 +03:00
Noah Gorny
05aac8ef39 Merge pull request #1956 from gaelicWizard/plugin-percol
plugin/percol `shellcheck`
2021-09-28 15:06:33 +03:00
Noah Gorny
37577550e1 Merge pull request #1963 from gaelicWizard/completion-laravel
completion/laravel: simplify code flow
2021-09-28 14:34:51 +03:00
John D Pell
b0750fa49f completion/git: shfmt && shellcheck 2021-09-24 21:11:28 -07:00
John D Pell
92282c4795 plugin/percol: shellcheck & shfmt
According to `shellcheck`, the `_tac` alias simply doesn't work. At all. Ever. See SC2262 and SC2263.
2021-09-24 00:39:07 -07:00
John D Pell
5857648377 plugins/less-pretty-cat: simplify code flow
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 10:17:28 -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
John D Pell
8a81fd7271 plugins/ruby: prepare for shellcheck 2021-09-22 13:33:34 -07:00
John D Pell
c98424308a plugins/direnv: use _command_exists 2021-09-19 21:58:48 -07:00
John D Pell
b038ea5869 plugins/nodenv: use _command_exists 2021-09-19 21:58:48 -07:00
John D Pell
f0179c79ce plugins/plenv: use _command_exists 2021-09-19 21:58:48 -07:00
John D Pell
a31145335e plugins/pyenv: use _command_exists 2021-09-19 21:58:48 -07:00
John D Pell
cff6f3464a plugins/rbenv: use _command_exists 2021-09-19 21:58:48 -07:00