Skip to content

Instantly share code, notes, and snippets.

@dgmike
Last active February 24, 2017 20:10
Show Gist options
  • Save dgmike/9e9bf2f1fccd513f0b9d4f23bcf5bb78 to your computer and use it in GitHub Desktop.
Save dgmike/9e9bf2f1fccd513f0b9d4f23bcf5bb78 to your computer and use it in GitHub Desktop.
Run codeclimate only on files that differs from another branch
function changed_files {
local BASE_BRANCH=$*
git diff --name-only ${BASE_BRANCH:="origin/staging"} | grep -v Gemfile | grep -v .codeclimate | grep -v db/schema.rb | tr "\n" " "
}
function canalyze {
codeclimate analyze $(changed_files) $*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment