Class: GrammarLinter Abstract

Inherits:
GrammarPlugin show all
Defined in:
lib/ruby_grammar_builder/grammar_plugin.rb

Overview

This class is abstract.

Subclass and override #pre_lint and/or #post_lint to implement a linter

Instance Method Summary collapse

Methods inherited from GrammarPlugin

display_options, options

Instance Method Details

#post_lint(grammar_hash) ⇒ Boolean

Runs the linter on the entire grammar

Parameters:

  • grammar_hash (Hash)

    The entire grammar

Returns:

  • (Boolean)

    the result og the lint



54
55
56
# File 'lib/ruby_grammar_builder/grammar_plugin.rb', line 54

def post_lint(grammar_hash) # rubocop:disable Lint/UnusedMethodArgument
    true
end

#pre_lint(pattern, options = {}) ⇒ Boolean

Runs the linter on each pattern

Parameters:

  • pattern (PatternBase, Symbol, Hash)

    the pattern to lint

  • options (Hash) (defaults to: {})

    hash of any of the option keys provided by self.options. options will only be populated when pattern is a PatternBase

Returns:

  • (Boolean)

    the result of the lint



43
44
45
# File 'lib/ruby_grammar_builder/grammar_plugin.rb', line 43

def pre_lint(pattern, options = {}) # rubocop:disable Lint/UnusedMethodArgument
    true
end