Skip to content

Commit 1dd1127

Browse files
committed
Patched pep8 to comply with pydocstyle; Closes #228.
Purposely ignoring D102 and D203 error codes. - D102 appears to be a bug with D102 - D203 should be ignored by default by pydocstyle)
1 parent 2e151c5 commit 1dd1127

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

pep8.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ def whitespace_before_comment(logical_line, tokens):
837837

838838

839839
def imports_on_separate_lines(logical_line):
840-
r"""Imports should usually be on separate lines.
840+
r"""Place imports on separate lines.
841841
842842
Okay: import os\nimport sys
843843
E401: import sys, os
@@ -857,8 +857,10 @@ def imports_on_separate_lines(logical_line):
857857

858858
def module_imports_on_top_of_file(
859859
logical_line, indent_level, checker_state, noqa):
860-
r"""Imports are always put at the top of the file, just after any module
861-
comments and docstrings, and before module globals and constants.
860+
r"""Place imports at the top of the file.
861+
862+
Always put imports at the top of the file, just after any module comments
863+
and docstrings, and before module globals and constants.
862864
863865
Okay: import os
864866
Okay: # this is a comment\nimport os
@@ -1166,7 +1168,7 @@ def python_3000_not_equal(logical_line):
11661168

11671169

11681170
def python_3000_backticks(logical_line):
1169-
r"""Backticks are removed in Python 3: use repr() instead.
1171+
r"""Use repr() instead of backticks in Python 3.
11701172
11711173
Okay: val = repr(1 + 2)
11721174
W604: val = `1 + 2`
@@ -1205,7 +1207,9 @@ def readlines(filename):
12051207
isidentifier = str.isidentifier
12061208

12071209
def stdin_get_value():
1210+
"""Read the value from stdin."""
12081211
return TextIOWrapper(sys.stdin.buffer, errors='ignore').read()
1212+
12091213
noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search
12101214

12111215

@@ -1439,7 +1443,7 @@ def run_check(self, check, argument_names):
14391443
return check(*arguments)
14401444

14411445
def init_checker_state(self, name, argument_names):
1442-
""" Prepares a custom state for the specific checker plugin."""
1446+
"""Prepare custom state for the specific checker plugin."""
14431447
if 'checker_state' in argument_names:
14441448
self.checker_state = self._checker_states.setdefault(name, {})
14451449

@@ -1721,6 +1725,7 @@ def print_benchmark(self):
17211725

17221726
class FileReport(BaseReport):
17231727
"""Collect the results of the checks and print only the filenames."""
1728+
17241729
print_filename = True
17251730

17261731

@@ -1928,6 +1933,7 @@ def get_checks(self, argument_name):
19281933

19291934

19301935
def get_parser(prog='pep8', version=__version__):
1936+
"""Create the parser for the program."""
19311937
parser = OptionParser(prog=prog, version=version,
19321938
usage="%prog [options] input ...")
19331939
parser.config_options = [
@@ -1989,7 +1995,7 @@ def get_parser(prog='pep8', version=__version__):
19891995

19901996

19911997
def read_config(options, args, arglist, parser):
1992-
"""Read and parse configurations
1998+
"""Read and parse configurations.
19931999
19942000
If a config file is specified on the command line with the "--config"
19952001
option, then only it is used for configuration.

0 commit comments

Comments
 (0)