Class: RakeCommandFilter::ScssLintCommandDefinition
- Inherits:
-
CommandDefinition
- Object
- CommandDefinition
- RakeCommandFilter::ScssLintCommandDefinition
- Defined in:
- lib/scss_lint_command_definition.rb
Overview
default way to run rubocop and parse its output
Instance Attribute Summary
Attributes inherited from CommandDefinition
#default_line_handling, #filter, #name
Class Method Summary collapse
- .error_msg ⇒ Object
-
.warning_msg ⇒ Object
for testing.
Instance Method Summary collapse
-
#initialize(id = 'scss-lint') ⇒ ScssLintCommandDefinition
constructor
Default parser for scss lint output.
Methods inherited from CommandDefinition
#add_filter, #add_parameter, create_result, #execute, find_worst_result, result_failure, result_success, result_warning
Constructor Details
#initialize(id = 'scss-lint') ⇒ ScssLintCommandDefinition
Default parser for scss lint output.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/scss_lint_command_definition.rb', line 15 def initialize(id = 'scss-lint') super(id) # just use sensible defaults here. add_filter(:scss_error, /(.*\[(.)\].*)/) do |matches| kind = matches[1] if kind == 'W' CommandDefinition.result_warning(ScssLintCommandDefinition.warning_msg) else CommandDefinition.result_failure(ScssLintCommandDefinition.error_msg) end end end |
Class Method Details
.error_msg ⇒ Object
9 10 11 |
# File 'lib/scss_lint_command_definition.rb', line 9 def self.error_msg 'One or more scss errors, see above' end |
.warning_msg ⇒ Object
for testing
5 6 7 |
# File 'lib/scss_lint_command_definition.rb', line 5 def self.warning_msg 'One or more scss warnings, see above' end |