Created
September 9, 2021 14:16
-
-
Save colindensem/8e9b64994bafc00d41cb99cef0d5c51d to your computer and use it in GitHub Desktop.
Revisions
-
colindensem created this gist
Sep 9, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ require "spec_helper" RSpec.describe "Check we pass codeclimate" do before do current_sha = "master..HEAD" @files = `git diff-tree --no-commit-id --name-only -r #{current_sha}` @files.tr!("\n", " ") ignore_files(@files) end it "passes CodeClimate on modified files" do if @files.empty? puts "CodeClimate not performed. No files changed." else puts "Running Codeclimate for changed files: #{@files}" result = system "codeclimate analyze #{@files}" expect(result).to be(true) end end def ignore_files(files) files.slice!("db/schema.rb") files end end