Skip to content

Commit

Permalink
Rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mathroule committed Dec 30, 2019
1 parent 60014c1 commit ea0103e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pmd/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def report_files
# It fails if `report_file` cannot be found inside current directory.
# It fails if `report_files` is empty.
# @return [Array[PmdFile]]
def report(inline_mode = true)
def report(inline_comment = true)
unless skip_gradle_task
return fail("Could not find `gradlew` inside current directory") unless gradlew_exists?

Expand All @@ -111,7 +111,7 @@ def report(inline_mode = true)
report_files_expanded = Dir.glob(report_files).sort
return fail("Could not find matching PMD report files for #{report_files} inside current directory") if report_files_expanded.empty?

report_and_send_inline_comment(report_files_expanded, inline_mode)
do_comment(report_files_expanded, inline_comment)
end

private
Expand Down Expand Up @@ -157,7 +157,7 @@ def target_files

# Generate report and send inline comment with Danger's warn or fail method.
# @return [Array[PmdFile]]
def report_and_send_inline_comment(report_files, inline_mode = true)
def do_comment(report_files, inline_comment = true)
pmd_issues = []

report_files.each do |report_file|
Expand All @@ -167,7 +167,7 @@ def report_and_send_inline_comment(report_files, inline_mode = true)
pmd_issues.push(pmd_file)

pmd_file.violations.each do |pmd_violation|
if inline_mode
if inline_comment
send(pmd_violation.type, pmd_violation.description, file: pmd_file.relative_path, line: pmd_violation.line)
else
send(pmd_violation.type, "#{pmd_file.relative_path} : #{pmd_violation.description} at #{pmd_violation.line}")
Expand Down

0 comments on commit ea0103e

Please sign in to comment.