Class: Lintrunner::Parser::SCSSLint
- Inherits:
-
Object
- Object
- Lintrunner::Parser::SCSSLint
- Defined in:
- lib/lintrunner/parser/scss_lint.rb
Instance Method Summary collapse
-
#parse(output, exit_code, options = {}) ⇒ Object
Example output of scss-lint (using the json formatter): { “app/styles/pages/delivery/_add_guests.scss”: [ { “line”: 9, “column”: 14, “length”: 16, “severity”: “warning”, “reason”: “Shorthand form for property ‘padding` should be written more concisely as `32px 70px 0` instead of `32px 70px 0 70px`”, “linter”: “Shorthand” } ] }.
Instance Method Details
#parse(output, exit_code, options = {}) ⇒ Object
Example output of scss-lint (using the json formatter): {
"app/styles/pages/delivery/_add_guests.scss": [
{
"line": 9,
"column": 14,
"length": 16,
"severity": "warning",
"reason": "Shorthand form for property `padding` should be written more concisely as `32px 70px 0` instead of `32px 70px 0 70px`",
"linter": "Shorthand"
}
]
}
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lintrunner/parser/scss_lint.rb', line 18 def parse(output, exit_code, = {}) return [] unless exit_code == 1 = [] JSON.parse(output).each do |filename, lints| lints.each do |lint| << Lintrunner::Message.new( filename: [:filename] || filename, line: lint["line"], name: lint["linter"], description: lint["reason"]) end end end |