@@ -855,7 +855,7 @@ def whitespace_before_comment(logical_line, tokens):
855855
856856
857857def imports_on_separate_lines (logical_line ):
858- r"""Imports should usually be on separate lines.
858+ r"""Place imports on separate lines.
859859
860860 Okay: import os\nimport sys
861861 E401: import sys, os
@@ -875,8 +875,10 @@ def imports_on_separate_lines(logical_line):
875875
876876def module_imports_on_top_of_file (
877877 logical_line , indent_level , checker_state , noqa ):
878- r"""Imports are always put at the top of the file, just after any module
879- comments and docstrings, and before module globals and constants.
878+ r"""Place imports at the top of the file.
879+
880+ Always put imports at the top of the file, just after any module comments
881+ and docstrings, and before module globals and constants.
880882
881883 Okay: import os
882884 Okay: # this is a comment\nimport os
@@ -1184,7 +1186,7 @@ def python_3000_not_equal(logical_line):
11841186
11851187
11861188def python_3000_backticks (logical_line ):
1187- r"""Backticks are removed in Python 3: use repr() instead .
1189+ r"""Use repr() instead of backticks in Python 3.
11881190
11891191 Okay: val = repr(1 + 2)
11901192 W604: val = `1 + 2`
@@ -1223,7 +1225,9 @@ def readlines(filename):
12231225 isidentifier = str .isidentifier
12241226
12251227 def stdin_get_value ():
1228+ """Read the value from stdin."""
12261229 return TextIOWrapper (sys .stdin .buffer , errors = 'ignore' ).read ()
1230+
12271231noqa = re .compile (r'# no(?:qa|pep8)\b' , re .I ).search
12281232
12291233
@@ -1457,7 +1461,7 @@ def run_check(self, check, argument_names):
14571461 return check (* arguments )
14581462
14591463 def init_checker_state (self , name , argument_names ):
1460- """ Prepares a custom state for the specific checker plugin."""
1464+ """Prepare custom state for the specific checker plugin."""
14611465 if 'checker_state' in argument_names :
14621466 self .checker_state = self ._checker_states .setdefault (name , {})
14631467
@@ -1739,6 +1743,7 @@ def print_benchmark(self):
17391743
17401744class FileReport (BaseReport ):
17411745 """Collect the results of the checks and print only the filenames."""
1746+
17421747 print_filename = True
17431748
17441749
@@ -1946,6 +1951,7 @@ def get_checks(self, argument_name):
19461951
19471952
19481953def get_parser (prog = 'pep8' , version = __version__ ):
1954+ """Create the parser for the program."""
19491955 parser = OptionParser (prog = prog , version = version ,
19501956 usage = "%prog [options] input ..." )
19511957 parser .config_options = [
@@ -2007,7 +2013,7 @@ def get_parser(prog='pep8', version=__version__):
20072013
20082014
20092015def read_config (options , args , arglist , parser ):
2010- """Read and parse configurations
2016+ """Read and parse configurations.
20112017
20122018 If a config file is specified on the command line with the "--config"
20132019 option, then only it is used for configuration.
0 commit comments