Commit Graph

10 Commits (dca96e0c39b2548234e583a6eb5ce981b682f4f5)

Author SHA1 Message Date
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 85408743fa lib/log: default to no logging at all
Set the default when BASH_IT_LOG_LEVEL is unbound to log level none: no warnings or errors are reported at all.
2021-08-26 14:11:41 -07:00
John D Pell 233fcc3091 lib/log: handle undefined variable
Expressly deal with if $echo_yellow hasn’t been defined
2021-08-26 14:11:41 -07:00
John D Pell 02c13b7921 lib/log: handle undefined variables
If the user hasn't defined BASH_IT_LOG_LEVEL, then the integer comparison fails. Handle it by defaulting to '1'.
If lib/log is loaded improperly, the BASH_IT_LOG_PREFIX may be undefined. Unlikely, but no harm in handling it too.
Likewise, if no theme is loaded, then $echo_green, $echo_normal, et al are not defined.
2021-08-26 14:11:41 -07:00
Noah Gorny 72dbfd2480 lib: log: Insert log level before message prefix
Also fix tests accordinly
2020-07-02 21:11:40 +03:00
Noah Gorny e6ebcda608 log: Fix logging to comply with the tests 2020-07-02 21:11:40 +03:00
Noah Gorny 8a3cf76307 lib: Move _has_colors to log module 2020-07-02 20:13:42 +03:00
Noah Gorny 9a23725ce0 log: Add BASH_IT_LOG_PREFIX option
Also add a new test to check it
2020-06-25 00:16:16 +03:00
Noah Gorny 3e7a95660f lib: Add _has_colors function and use it in log output 2020-06-23 15:42:22 +03:00
Noah Gorny 802c45b401 lib: Add log module 2020-06-23 15:12:43 +03:00