Skip to content

Commit 9b53ce0

Browse files
committed
Using build_options now.
1 parent 49b89ca commit 9b53ce0

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

pep8.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,22 @@ class PEP8(PythonLinter):
6161
module = 'pep8'
6262

6363
def check(self, code, filename):
64-
"""Run pep8.Checker on code and return the output."""
64+
"""Run pep8 on code and return the output."""
6565

66-
view_settings = self.get_view_settings()
67-
68-
kwargs = {
69-
'select': view_settings.get('select', '').split(','),
70-
'ignore': view_settings.get('ignore', '').split(','),
71-
'max_line_length': view_settings.get('max-line-length'),
66+
options = {
7267
'reporter': Report
7368
}
7469

75-
checker = self.module.StyleGuide(**kwargs)
70+
type_map = {
71+
'select': [],
72+
'ignore': [],
73+
'max-line-length': 0,
74+
'max-complexity': 0
75+
}
76+
77+
self.build_options(options, type_map, transform=lambda s: s.replace('-', '_'))
78+
79+
checker = self.module.StyleGuide(**options)
7680

7781
return checker.input_file(
7882
filename=os.path.basename(filename),

0 commit comments

Comments
 (0)