From 1e2427bfd19b8642a12ff646acbd9f8267dd5fab Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 10 Sep 2017 14:46:58 +0200 Subject: [PATCH] linting --- .travis.yml | 4 ++-- bash_aliases | 4 ++-- bash_profile | 2 ++ bash_prompt | 4 ++++ bin/updaterepos.sh | 2 +- readme.md | 2 ++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 51c212b..e703f6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,8 @@ addons: - shellcheck script: - - bash -c 'shopt -s globstar; shellcheck **/bash_*' - - bash -c 'shopt -s globstar; shellcheck **/*.{sh,bash}' + - bash -c 'shopt -s globstar; shellcheck **/bash*' + - bash -c 'shopt -s globstar; shellcheck **/*.sh' matrix: fast_finish: true diff --git a/bash_aliases b/bash_aliases index ba4f0b2..9af7dfb 100644 --- a/bash_aliases +++ b/bash_aliases @@ -23,10 +23,10 @@ alias ip="dig +short myip.opendns.com @resolver1.opendns.com" alias localip="ipconfig getifaddr en1" # Copy SSH public key to pasteboard -alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | printf '$(tput setaf 64)✓ Public SSH key copied to pasteboard.$(tput sgr0)\n'" +alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | printf '\$(tput setaf 64)✓ Public SSH key copied to pasteboard.\$(tput sgr0)\n'" # Copy GPG public key to pasteboard -alias gpgpubkey="gpg --export --armor 0xDD7831FC | pbcopy | printf '$(tput setaf 64)✓ Public GPG key copied to pasteboard.$(tput sgr0)\n'" +alias gpgpubkey="gpg --export --armor 0xDD7831FC | pbcopy | printf '\$(tput setaf 64)✓ Public GPG key copied to pasteboard.\$(tput sgr0)\n'" # Recursively delete `.DS_Store` files alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" diff --git a/bash_profile b/bash_profile index b0aea9e..0f3d682 100644 --- a/bash_profile +++ b/bash_profile @@ -62,6 +62,7 @@ PROMPT_DIRTRIM=4 # Add tab completion for many Bash commands if which brew &> /dev/null && [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then + # shellcheck source=/dev/null source "$(brew --prefix)/share/bash-completion/bash_completion"; elif [ -f /etc/bash_completion ]; then # shellcheck disable=SC1091 @@ -95,6 +96,7 @@ complete -C aws_completer aws # ---------------------------------------------------------------------- # Load RVM into a shell session *as a function* +# shellcheck source=/dev/null [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" diff --git a/bash_prompt b/bash_prompt index 5abc68a..c66c07b 100644 --- a/bash_prompt +++ b/bash_prompt @@ -26,11 +26,13 @@ prompt_git() { git update-index --really-refresh -q &>/dev/null; # Check for uncommitted changes in the index. + # shellcheck disable=SC2091 if ! $(git diff --quiet --ignore-submodules --cached); then s+='+'; fi; # Check for unstaged changes. + # shellcheck disable=SC2091 if ! $(git diff-files --quiet --ignore-submodules --); then s+='!'; fi; @@ -41,6 +43,7 @@ prompt_git() { fi; # Check for stashed files. + # shellcheck disable=SC2091 if $(git rev-parse --verify refs/stash &>/dev/null); then s+='$'; fi; @@ -62,6 +65,7 @@ prompt_git() { fi; } +# shellcheck disable=SC2034 if tput setaf 1 &> /dev/null; then tput sgr0; # reset colors bold=$(tput bold); diff --git a/bin/updaterepos.sh b/bin/updaterepos.sh index d99e26d..7234317 100755 --- a/bin/updaterepos.sh +++ b/bin/updaterepos.sh @@ -54,7 +54,7 @@ echo "$(tput setaf 240)Updating git repos in directory: $directory_to_update $(t count=0 -for dir in $(find "$directory_to_update" -maxdepth 4 -type d -name .git | xargs -n 1 dirname); do +for dir in $(find "$directory_to_update" -maxdepth 4 -type d -name .git -print0 | xargs -n -0 1 dirname); do updateRepo "$dir" "$directory_to_update" ((count+=1)) done diff --git a/readme.md b/readme.md index b37e272..e72739a 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,8 @@ > 👩‍🎤 personal dotfiles, scrambled together from the interwebz. Highly macOS oriented. +[![Build Status](https://travis-ci.org/kremalicious/dotfiles.svg?branch=master)](https://travis-ci.org/kremalicious/dotfiles) + ![hackerman](https://cloud.githubusercontent.com/assets/90316/26279873/9240a9d8-3dc0-11e7-9353-783b36ae6aff.jpg) ## Installation