@@ -837,7 +837,7 @@ def whitespace_before_comment(logical_line, tokens):
837837
838838
839839def 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
858858def 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
11681170def 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+
12091213noqa = 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
17221726class 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
19301935def 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
19911997def 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