Class: QuietQuality::Tools::Rubocop::Runner

Inherits:
QuietQuality::Tools::RelevantRunner show all
Defined in:
lib/quiet_quality/tools/rubocop/runner.rb

Constant Summary

Constants inherited from QuietQuality::Tools::RelevantRunner

QuietQuality::Tools::RelevantRunner::MAX_FILES

Constants inherited from BaseRunner

BaseRunner::MAX_FILES

Instance Method Summary collapse

Methods inherited from QuietQuality::Tools::RelevantRunner

#command, #exec_command, #invoke!

Methods inherited from BaseRunner

#command, #exec_command, #failure_status?, #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/rubocop/runner.rb', line 13

def base_command
  ["rubocop", "-f", "json"]
end

#base_exec_commandObject



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

def base_exec_command
  ["rubocop"]
end

#no_files_outputObject



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

def no_files_output
  '{"files": [], "summary": {"offense_count": 0}}'
end

#relevant_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#tool_nameObject



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

def tool_name
  TOOL_NAME
end