@@ -13,14 +13,14 @@ can be highly useful for automated testing of coding style conformance
1313in your project::
1414
1515 import unittest
16- import pep8
16+ import pycodestyle
1717
1818
1919 class TestCodeFormat(unittest.TestCase):
2020
2121 def test_pep8_conformance(self):
2222 """Test that we conform to PEP8."""
23- pep8style = pep8 .StyleGuide(quiet=True)
23+ pep8style = pycodestyle .StyleGuide(quiet=True)
2424 result = pep8style.check_files(['file1.py', 'file2.py'])
2525 self.assertEqual(result.total_errors, 0,
2626 "Found code style errors (and warnings).")
@@ -30,9 +30,9 @@ since Nose suppresses stdout.
3030
3131There's also a shortcut for checking a single file::
3232
33- import pep8
33+ import pycodestyle
3434
35- fchecker = pep8 .Checker('testsuite/E27.py', show_source=True)
35+ fchecker = pycodestyle .Checker('testsuite/E27.py', show_source=True)
3636 file_errors = fchecker.check_all()
3737
3838 print("Found %s errors (and warnings)" % file_errors)
@@ -46,13 +46,13 @@ You can configure automated ``pep8`` tests in a variety of ways.
4646For example, you can pass in a path to a configuration file that ``pep8 ``
4747should use::
4848
49- import pep8
49+ import pycodestyle
5050
51- pep8style = pep8 .StyleGuide(config_file='/path/to/tox.ini')
51+ pep8style = pycodestyle .StyleGuide(config_file='/path/to/tox.ini')
5252
5353You can also set specific options explicitly::
5454
55- pep8style = pep8 .StyleGuide(ignore=['E501'])
55+ pep8style = pycodestyle .StyleGuide(ignore=['E501'])
5656
5757
5858Skip file header
@@ -64,19 +64,19 @@ at the beginning and the end of a file. This use case is easy to implement
6464through a custom wrapper for the PEP 8 library::
6565
6666 #!python
67- import pep8
67+ import pycodestyle
6868
6969 LINES_SLICE = slice(14, -20)
7070
71- class PEP8(pep8 .StyleGuide):
72- """This subclass of pep8 .StyleGuide will skip the first and last lines
71+ class PEP8(pycodestyle .StyleGuide):
72+ """This subclass of pycodestyle .StyleGuide will skip the first and last lines
7373 of each file."""
7474
7575 def input_file(self, filename, lines=None, expected=None, line_offset=0):
7676 if lines is None:
7777 assert line_offset == 0
7878 line_offset = LINES_SLICE.start or 0
79- lines = pep8 .readlines(filename)[LINES_SLICE]
79+ lines = pycodestyle .readlines(filename)[LINES_SLICE]
8080 return super(PEP8, self).input_file(
8181 filename, lines=lines, expected=expected, line_offset=line_offset)
8282
0 commit comments