Class: CC::Engine::HamlLint

Inherits:
Object
  • Object
show all
Defined in:
lib/cc/engine/haml_lint.rb

Overview

Lints files in the Code Climate format

Instance Method Summary collapse

Constructor Details

#initialize(root:, engine_config:, io:) ⇒ CC::Engine::HamlLint

Instantiates a new HamlLint engine

Examples:

CC::Engine::HamlLint.new(
  root: Dir.pwd,
  engine_config: CC::Engine::Configuration.new,
  io: STDOUT
)

30
31
32
33
34
# File 'lib/cc/engine/haml_lint.rb', line 30

def initialize(root:, engine_config:, io:)
  @engine_config = engine_config || CC::Engine::Configuration.new
  @io = io
  @root = root
end

Instance Method Details

#runvoid

This method returns an undefined value.

Lints files based on the engine configuration

Examples:

CC::Engine::HamlLint.new(
  root: Dir.pwd,
  engine_config: CC::Engine::Configuration.new,
  io: STDOUT
).run

47
48
49
50
51
52
53
54
55
56
# File 'lib/cc/engine/haml_lint.rb', line 47

def run
  files_to_inspect.each do |path|
    SourceFile.new(
      linter_config: linter_config,
      io: io,
      path: path,
      root: root
    ).process
  end
end