Class: ERBLint::Linters::ParserErrors

Inherits:
ERBLint::Linter show all
Includes:
ERBLint::LinterRegistry
Defined in:
lib/erb_lint/linters/parser_errors.rb

Constant Summary

Constants included from ERBLint::LinterRegistry

ERBLint::LinterRegistry::CUSTOM_LINTERS_DIR

Instance Attribute Summary

Attributes inherited from ERBLint::Linter

#offenses

Instance Method Summary collapse

Methods included from ERBLint::LinterRegistry

find_by_name, included, load_custom_linters

Methods inherited from ERBLint::Linter

#add_offense, #clear_offenses, #enabled?, #excludes_file?, inherited, #initialize, support_autocorrect?

Constructor Details

This class inherits a constructor from ERBLint::Linter

Instance Method Details

#run(processed_source) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/erb_lint/linters/parser_errors.rb', line 8

def run(processed_source)
  processed_source.parser.parser_errors.each do |error|
    add_offense(
      error.loc,
      "#{error.message} (at #{error.loc.source})"
    )
  end
end