Class: Checkstyle::FileReviewer
- Inherits:
-
Object
- Object
- Checkstyle::FileReviewer
- Defined in:
- lib/checkstyle/file_reviewer.rb
Constant Summary collapse
- HEADERS =
{ 'Authorization' => "token #{ENV['GITHUB_TOKEN']}" }
- RUBOCOP_QUOTES =
[ "> - Robo, excuse me, Robo. Any special message for all the kids watching at home?\n> - Stay out of trouble.", '> Four... three... two... one... I am now authorized to use physical force!', '> Thank you for your co-operation. Good night.', '> Serve the public trust. Protect the innocent. Uphold the law.', '> Your move, creep.', '> Come quietly or there will be trouble.', '> You are under arrest.', "> Dead or alive, you're coming with me!", '> Oooh, guns guns guns!', '> Excuse me, I have to go. Somewhere there is a crime happening.' ]
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#violations ⇒ Object
readonly
Returns the value of attribute violations.
Instance Method Summary collapse
-
#initialize(repository, file_path, violations) ⇒ FileReviewer
constructor
A new instance of FileReviewer.
- #review ⇒ Object
Constructor Details
#initialize(repository, file_path, violations) ⇒ FileReviewer
Returns a new instance of FileReviewer.
23 24 25 26 27 |
# File 'lib/checkstyle/file_reviewer.rb', line 23 def initialize(repository, file_path, violations) @file_path = file_path @violations = violations @repository = repository end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
21 22 23 |
# File 'lib/checkstyle/file_reviewer.rb', line 21 def file_path @file_path end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
21 22 23 |
# File 'lib/checkstyle/file_reviewer.rb', line 21 def repository @repository end |
#violations ⇒ Object (readonly)
Returns the value of attribute violations.
21 22 23 |
# File 'lib/checkstyle/file_reviewer.rb', line 21 def violations @violations end |
Instance Method Details
#review ⇒ Object
29 30 31 32 33 |
# File 'lib/checkstyle/file_reviewer.rb', line 29 def review log "Reviewing file #{file_path}" violations.each { |violation| comment_violation(violation) } end |