Last active
February 24, 2017 20:10
-
-
Save dgmike/9e9bf2f1fccd513f0b9d4f23bcf5bb78 to your computer and use it in GitHub Desktop.
Run codeclimate only on files that differs from another branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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