Skip to content

Commit

Permalink
Merge pull request #2106 from gaelicWizard/bats/shfmt
Browse files Browse the repository at this point in the history
BATS: `shfmt`
  • Loading branch information
seefood authored Nov 19, 2024
2 parents 3c0baf5 + 3f58bbe commit 50183db
Show file tree
Hide file tree
Showing 20 changed files with 1,725 additions and 1,733 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ repos:
- id: git-check # Configure in .gitattributes
- id: shellcheck
- id: shfmt
exclude: ".bats$"
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.7
hooks:
Expand Down
446 changes: 223 additions & 223 deletions test/bash_it/bash_it.bats

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions test/completion/aliases.completion.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash"

function local_setup_file() {
setup_libs "helpers"
# Load something, anything...
load ../../completion/available/capistrano.completion
setup_libs "helpers"
# Load something, anything...
load ../../completion/available/capistrano.completion
}

@test "alias-completion: See that aliases with double quotes and brackets do not break the plugin" {
alias gtest="git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative"
run load "${BASH_IT?}/completion/available/aliases.completion.bash"
alias gtest="git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative"
run load "${BASH_IT?}/completion/available/aliases.completion.bash"

assert_success
assert_success
}

@test "alias-completion: See that aliases with single quotes and brackets do not break the plugin" {
alias gtest='git log --graph --pretty=format:"%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset" --abbrev-commit --date=relative'
run load "${BASH_IT?}/completion/available/aliases.completion.bash"
alias gtest='git log --graph --pretty=format:"%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset" --abbrev-commit --date=relative'
run load "${BASH_IT?}/completion/available/aliases.completion.bash"

assert_success
assert_success
}

@test "alias-completion: See that having aliased rm command does not output unnecessary output" {
alias rm='rm -v'
run load "${BASH_IT?}/completion/available/aliases.completion.bash"
alias rm='rm -v'
run load "${BASH_IT?}/completion/available/aliases.completion.bash"

assert_output ""
assert_output ""
}
Loading

0 comments on commit 50183db

Please sign in to comment.