Class: Danger::DangerResharperInspectcode
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerResharperInspectcode
- Defined in:
- lib/resharper_inspectcode/plugin.rb
Overview
Danger plugin for JetBrains ReSharper InspectCode.
Instance Attribute Summary collapse
-
#base_path ⇒ String
Base path of report file.
Instance Method Summary collapse
-
#initialize(dangerfile) ⇒ DangerResharperInspectcode
constructor
A new instance of DangerResharperInspectcode.
-
#report(file) ⇒ void
Report warnings.
Constructor Details
#initialize(dangerfile) ⇒ DangerResharperInspectcode
Returns a new instance of DangerResharperInspectcode.
33 34 35 36 |
# File 'lib/resharper_inspectcode/plugin.rb', line 33 def initialize(dangerfile) super(dangerfile) @base_path ||= Dir.pwd end |
Instance Attribute Details
#base_path ⇒ String
Base path of report file
16 17 18 |
# File 'lib/resharper_inspectcode/plugin.rb', line 16 def base_path @base_path end |
Instance Method Details
#report(file) ⇒ void
This method returns an undefined value.
Report warnings
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/resharper_inspectcode/plugin.rb', line 21 def report(file) raise "Please specify file name." if file.empty? filepath = @base_path + (@base_path.end_with?("/") ? "" : "/") + file raise "No report file was found at #{filepath}" unless File.exist?(filepath) issues = ReportParser.parse_report_xml(filepath) issues.each do |issue| warn(issue., file: issue.file, line: issue.line) end end |