lib/kotlin_detekt/plugin.rb in danger-kotlin_detekt-0.0.1 vs lib/kotlin_detekt/plugin.rb in danger-kotlin_detekt-0.0.2
- old
+ new
@@ -17,24 +17,24 @@
# @tags monday, weekends, time, rattata
#
class DangerKotlinDetekt < Plugin
SEVERITY_LEVELS = ["warning", "error"]
- # Location of lint report file
- # If your Android lint task outputs to a different location, you can specify it here.
- # Defaults to "app/build/reports/lint/lint-result.xml".
+ # Location of Detekt report file
+ # If your Detekt task outputs to a different location, you can specify it here.
+ # Defaults to "build/reports/detekt/detekt-checkstyle.xml".
# @return [String]
attr_accessor :report_file
# A getter for `report_file`.
# @return [String]
def report_file
return @report_file || 'build/reports/detekt/detekt-checkstyle.xml'
end
# Custom gradle task to run.
# This is useful when your project has different flavors.
- # Defaults to "lint".
+ # Defaults to "detektCheck".
# @return [String]
attr_accessor :gradle_task
# Defines the severity level of the execution.
# Selected levels are the chosen one and up.
@@ -48,11 +48,11 @@
attr_accessor :filtering
# Skip gradle task
attr_accessor :skip_gradle_task
- # Calls lint task of your gradle project.
+ # Calls Detekt task of your gradle project.
# It fails if `gradlew` cannot be found inside current directory.
# It fails if `severity` level is not a valid option.
# It fails if `xmlReport` configuration is not set to `true` in your `build.gradle` file.
# @return [void]
#
@@ -65,14 +65,14 @@
unless SEVERITY_LEVELS.include?(severity)
fail("'#{severity}' is not a valid value for `severity` parameter.")
return
end
- system "./gradlew #{gradle_task || 'lint'}" unless skip_gradle_task
+ system "./gradlew #{gradle_task || 'detektCheck'}" unless skip_gradle_task
unless File.exist?(report_file)
- fail("Lint report not found at `#{report_file}`. "\
+ fail("Detekt report not found at `#{report_file}`. "\
"Have you forgot to add `xmlReport true` to your `build.gradle` file?")
end
issues = read_issues_from_report
filtered_issues = filter_issues_by_severity(issues)
@@ -80,10 +80,10 @@
if inline_mode
# Report with inline comment
send_inline_comment(filtered_issues)
else
message = message_for_issues(filtered_issues)
- markdown("### AndroidLint found issues\n\n" + message) unless message.to_s.empty?
+ markdown("### Detekt found issues\n\n" + message) unless message.to_s.empty?
end
end
# A getter for `severity`, returning "warning" if value is nil.
# @return [String]