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