Class: QuietQuality::Tools::HamlLint::Runner

Inherits:
RelevantRunner show all
Defined in:
lib/quiet_quality/tools/haml_lint/runner.rb

Constant Summary

Constants inherited from RelevantRunner

RelevantRunner::MAX_FILES

Constants inherited from BaseRunner

BaseRunner::MAX_FILES

Instance Method Summary collapse

Methods inherited from RelevantRunner

#command, #exec_command, #invoke!

Methods inherited from BaseRunner

#command, #exec_command, #initialize, #invoke!, #success_status?

Methods included from Logging

#debug, #info, #warn

Constructor Details

This class inherits a constructor from QuietQuality::Tools::BaseRunner

Instance Method Details

#base_commandObject



13
14
15
# File 'lib/quiet_quality/tools/haml_lint/runner.rb', line 13

def base_command
  ["haml-lint", "--reporter", "json"]
end

#base_exec_commandObject



17
18
19
# File 'lib/quiet_quality/tools/haml_lint/runner.rb', line 17

def base_exec_command
  ["haml-lint"]
end

#failure_status?(stat) ⇒ Boolean

haml-lint uses the ‘sysexits` gem, and exits with Sysexits::EX_DATAERR for the failures case here in lib/haml_lint/cli.rb. That’s mapped to status 65 - other statuses have other failure meanings, which we don’t want to interpret as “problems encountered”

Returns:

  • (Boolean)


29
30
31
# File 'lib/quiet_quality/tools/haml_lint/runner.rb', line 29

def failure_status?(stat)
  stat.exitstatus == 65
end

#no_files_outputObject



9
10
11
# File 'lib/quiet_quality/tools/haml_lint/runner.rb', line 9

def no_files_output
  %({"files": []})
end

#relevant_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/quiet_quality/tools/haml_lint/runner.rb', line 21

def relevant_path?(path)
  path.end_with?(".haml")
end

#tool_nameObject



5
6
7
# File 'lib/quiet_quality/tools/haml_lint/runner.rb', line 5

def tool_name
  TOOL_NAME
end