File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ OptionParser.new do |opts|
2323 "Grep pattern to filter files. If provided, will filter the files changed on your branch further." )
2424end . parse! ( into : options )
2525
26- if options [ :baseline ]
27- CodeclimateDiff ::Runner . generate_baseline
28- elsif options [ :"new-only" ]
29- CodeclimateDiff ::Runner . run_diff_on_branch ( options [ :pattern ] , always_analyze_all_files : options [ :all ] , show_preexisting : false )
26+ if options [ :"new-only" ]
27+ CodeclimateDiff ::Runner . run_diff_on_branch ( options [ :pattern ] , always_analyze_all_files : options [ :all ] ,
28+ show_preexisting : false )
3029else
31- CodeclimateDiff ::Runner . run_diff_on_branch ( options [ :pattern ] , always_analyze_all_files : options [ :all ] , show_preexisting : true )
30+ CodeclimateDiff ::Runner . run_diff_on_branch ( options [ :pattern ] , always_analyze_all_files : options [ :all ] ,
31+ show_preexisting : true )
3232end
Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ def self.setup_baseline_for_branch
9595 system ( "git worktree add ../temp-codeclimate #{ main_branch } " )
9696
9797 Dir . chdir ( "../temp-codeclimate" ) do
98- # Execute shell command in the '../temp-codeclimate' directory
9998 generate_baseline
10099
101100 puts "Copying the baseline to #{ project_repo } ..."
@@ -107,8 +106,7 @@ def self.setup_baseline_for_branch
107106 end
108107
109108 def self . run_diff_on_branch ( pattern , always_analyze_all_files : false , show_preexisting : true )
110- # CodeclimateWrapper.new.pull_latest_image
111- setup_baseline_for_branch
109+ setup_baseline_for_branch unless File . exist? ( "codeclimate_diff_baseline.json" )
112110
113111 changed_filenames = calculate_changed_filenames ( pattern )
114112
You can’t perform that action at this time.
0 commit comments