Class: PreCommit::Checks::Checkstyle
- Inherits:
-
Shell
- Object
- Shell
- PreCommit::Checks::Checkstyle
- Defined in:
- lib/plugins/pre_commit/checks/checkstyle.rb
Overview
Plugin implementation for pre-commit gem
It provides a java checkstyle validation using checkstyle.jar for details see: lib/pre_commit/support/checkstyle
Class Method Summary collapse
Instance Method Summary collapse
-
#call(staged_files) ⇒ Object
Function called after pre-commit execution this method receive the
staged_files
from git.
Class Method Details
.description ⇒ Object
30 31 32 |
# File 'lib/plugins/pre_commit/checks/checkstyle.rb', line 30 def self.description 'Runs Checkstyle linter for java code.' end |
Instance Method Details
#call(staged_files) ⇒ Object
Function called after pre-commit execution this method receive the staged_files
from git
22 23 24 25 26 27 28 |
# File 'lib/plugins/pre_commit/checks/checkstyle.rb', line 22 def call(staged_files) staged_files = staged_files.grep(/\.java$/) return if staged_files.empty? output = execute(args(staged_files)) format(extract(output)) end |