Class: Quality::Tools::Flake8
- Inherits:
-
Tool
- Object
- Tool
- Quality::Tools::Flake8
show all
- Defined in:
- lib/quality/tools/flake8.rb
Overview
Adds ‘flake8’ tool support to quality gem
Instance Method Summary
collapse
Methods inherited from Tool
#initialize
Instance Method Details
#flake8_args ⇒ Object
7
8
9
|
# File 'lib/quality/tools/flake8.rb', line 7
def flake8_args
python_files.join(' ')
end
|
#flake8_count_errors(line) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/quality/tools/flake8.rb', line 11
def flake8_count_errors(line)
if line =~ /^Usage:/
0
elsif line =~ /^flake8: /
0
elsif line =~ /^$/
0
else
1
end
end
|
#quality_flake8 ⇒ Object
26
27
28
29
30
31
32
33
|
# File 'lib/quality/tools/flake8.rb', line 26
def quality_flake8
ratchet_quality_cmd('flake8',
args: flake8_args,
gives_error_code_on_no_relevant_code:
true) do |line|
flake8_count_errors(line)
end
end
|