Skip to content

Commit 0315f34

Browse files
committed
Make sure to round averages to avoid useless decimals
1 parent 3b84599 commit 0315f34

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/skunk/cli/commands/compare.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def analyse_modified_files
3030
# create a txt file with the branch score details
3131
def build_details
3232
details = "Base branch (#{::RubyCritic::Config.base_branch}) "\
33-
"average stink score: #{::RubyCritic::Config.base_branch_score} \n"\
33+
"average stink score: #{::RubyCritic::Config.base_branch_score.to_f.round(2)} \n"\
3434
"Feature branch (#{::RubyCritic::Config.feature_branch}) "\
35-
"average stink score: #{::RubyCritic::Config.feature_branch_score} \n"
35+
"average stink score: #{::RubyCritic::Config.feature_branch_score.to_f.round(2)} \n"
3636
Skunk::Command::Output.create_directory(::RubyCritic::Config.compare_root_directory)
3737
File.open(build_details_path, "w") { |file| file.write(details) }
3838
puts details

lib/skunk/cli/commands/status_reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def total_churn_times_cost
6464
def stink_score_average
6565
return 0 if analysed_modules_count.zero?
6666

67-
(total_stink_score.to_d / analysed_modules_count).to_f
67+
(total_stink_score.to_d / analysed_modules_count).to_f.round(2)
6868
end
6969

7070
def table_options

0 commit comments

Comments
 (0)