Class: LintTrap::Linter::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lint_trap/linter/base.rb

Overview

The base class for all linters. Provides a template for linter execution.

Constant Summary collapse

CONFIG_PATH =
File.expand_path('../../../../config', __FILE__)

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



24
25
26
# File 'lib/lint_trap/linter/base.rb', line 24

def ==(other)
  name == other.name
end

#lint(files, container, options) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/lint_trap/linter/base.rb', line 10

def lint(files, container, options)
  @container, @options = container, options

  command(files).run(container) do |stdout|
    parser(stdout).parse do |violation|
      yield violation
    end
  end
end

#nameObject



20
21
22
# File 'lib/lint_trap/linter/base.rb', line 20

def name
  self.class.name.split('::').last
end