Skip to content

Commit

Permalink
Merge pull request #378 from denny/fix/compare-file-structure
Browse files Browse the repository at this point in the history
Fix compare file structure
  • Loading branch information
etagwerker authored Jan 24, 2021
2 parents c06aae2 + 907fd13 commit d673a2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* [CHANGE] Fix rubocop offenses (by [@sl4vr][])
* [CHANGE] Make Github Linguist ignore vendored files (by [@sl4vr][])
* [BUGFIX] Fix directory structure of reports when comparing branches (by [@denny][])

# v4.5.2 / 2020-08-20 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.5.1...v4.5.2)

Expand Down
5 changes: 3 additions & 2 deletions lib/rubycritic/commands/compare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module Command
class Compare < Default
def initialize(options)
super
@original_config_root = Config.root
@build_number = 0
end

Expand Down Expand Up @@ -57,7 +58,7 @@ def analyse_branch(branch)
def analyse_modified_files
modified_files = Config.feature_branch_collection.where(SourceControlSystem::Git.modified_files)
analysed_modules = AnalysedModulesCollection.new(modified_files.map(&:path), modified_files)
Config.root = "#{Config.root}/compare"
Config.root = Config.compare_root_directory
report(analysed_modules)
end

Expand Down Expand Up @@ -85,7 +86,7 @@ def threshold_reached?
end

def branch_directory(branch)
"#{Config.root}/compare/#{Config.send(branch)}"
"#{@original_config_root}/compare/#{Config.send(branch)}"
end

# create a txt file with the branch score details
Expand Down

0 comments on commit d673a2c

Please sign in to comment.