Class: Codeqa::Checkers::Rubocop
Instance Attribute Summary
#errors, #sourcefile
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize
Class Method Details
.available? ⇒ Boolean
10
11
12
|
# File 'lib/codeqa/checkers/rubocop_full.rb', line 10
def self.available?
rubocop?
end
|
.check?(sourcefile) ⇒ Boolean
6
7
8
|
# File 'lib/codeqa/checkers/rubocop_full.rb', line 6
def self.check?(sourcefile)
sourcefile.ruby?
end
|
Instance Method Details
#check ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/codeqa/checkers/rubocop_full.rb', line 22
def check
return unless self.class.rubocop?
with_existing_file do |filename|
args = config_args << filename
success, raw_json = capture do
if defined?(RuboCop) ::RuboCop::CLI.new.run(default_args + args) == 0
else
::Rubocop::CLI.new.run(default_args + args) == 0
end
end
handle_rubocop_results(raw_json) unless success
end
end
|
#hint ⇒ Object
18
19
20
|
# File 'lib/codeqa/checkers/rubocop_full.rb', line 18
def hint
'Rubocop does not like your syntax, please fix your code.'
end
|
#name ⇒ Object
14
15
16
|
# File 'lib/codeqa/checkers/rubocop_full.rb', line 14
def name
'rubocop'
end
|