Class: Checkstyle::Reviewer
- Inherits:
-
Object
- Object
- Checkstyle::Reviewer
- Defined in:
- lib/checkstyle/reviewer.rb
Instance Attribute Summary collapse
-
#report_file_path ⇒ Object
readonly
Returns the value of attribute report_file_path.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#syntax_violation_report ⇒ Object
readonly
Returns the value of attribute syntax_violation_report.
Instance Method Summary collapse
-
#initialize(repository, report_file_path) ⇒ Reviewer
constructor
A new instance of Reviewer.
- #review ⇒ Object
Constructor Details
#initialize(repository, report_file_path) ⇒ Reviewer
Returns a new instance of Reviewer.
8 9 10 11 12 |
# File 'lib/checkstyle/reviewer.rb', line 8 def initialize(repository, report_file_path) @report_file_path = report_file_path @syntax_violation_report = JSON.parse(File.open(report_file_path).read).fetch('files', []) @repository = repository end |
Instance Attribute Details
#report_file_path ⇒ Object (readonly)
Returns the value of attribute report_file_path.
6 7 8 |
# File 'lib/checkstyle/reviewer.rb', line 6 def report_file_path @report_file_path end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
6 7 8 |
# File 'lib/checkstyle/reviewer.rb', line 6 def repository @repository end |
#syntax_violation_report ⇒ Object (readonly)
Returns the value of attribute syntax_violation_report.
6 7 8 |
# File 'lib/checkstyle/reviewer.rb', line 6 def syntax_violation_report @syntax_violation_report end |
Instance Method Details
#review ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/checkstyle/reviewer.rb', line 14 def review log "Reviewing based on #{report_file_path}" syntax_violation_report.each do |file_report| next if file_report.fetch('offenses', []).empty? review_file(file_report) end end |