Commit c663aaab authored by nimrod's avatar nimrod
Browse files

Pre-commit checks for .bashrc.

Because .bashrc was identified as a plain text file (it's not a shell
script), the shell-lint and shellcheck hooks weren't checking it. Add an
explicit hook just for it. Also, fix or silence whatever shellcheck
found.
parent 6ac8e33b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ alias detectproxy='w3m http://detectportal.firefox.com/success.txt'
alias color='less --raw-control-chars -p'
alias pip2='python2 -m pip'
alias pip3='python3 -m pip'
# shellcheck disable=SC2139
alias rc_update="make --directory $HOME --always-make"
alias gen-ssh-config="rc_update .ssh/config"
alias bfg='java -jar $HOME/.local/share/bfg/bfg.jar'
@@ -268,7 +269,7 @@ then
    [ -f /etc/bash_completion ] && . /etc/bash_completion

    # shellcheck disable=SC1090
    for sourcefile in $HOME/.bash_completion.d/*
    for sourcefile in "$HOME"/.bash_completion.d/*
    do
        [ ! -f "$sourcefile" ] || . "$sourcefile"
    done
+8 −1
Original line number Diff line number Diff line
@@ -18,4 +18,11 @@ repos:
        exclude: &excluded_shellscripts \.bash_completion\.d/(docker-machine\.bash|fabric-completion.bash|docker-compose)|\.travis/travis\.sh
    -   id: shellcheck
        exclude: *excluded_shellscripts
        include: .bashrc
    -   id: shell-lint
        alias: shell-lint .bashrc
        files: \.bashrc
        types: [text]
    -   id: shellcheck
        alias: Shellcheck .bashrc
        files: \.bashrc
        types: [text]