@@ -18,6 +18,8 @@ and [pydocstyle](https://github.com/PyCQA/pydocstyle).
1818
1919This is probably the linter to use, specifically for the ` PEP 8 ` integration.
2020
21+ In fact, it was formerly called ` pep8 ` .
22+
2123However, I still like ` pylint ` quite a lot, for one thing it will complain if a file is not named in a Pythonesque
2224way. And they've gamified ` pylint ` pretty well, it's oddly satisfying to clean up formatting and see the code score
2325improve.
@@ -66,6 +68,43 @@ Run `pyreverse` as follows:
6668
6769[ The default output format is ` dot ` , here we are specifying the graphic format ` png ` .]
6870
71+ ## An example of using ` pylint ` and ` pycodestyle `
72+
73+ Here we will use a quick test case:
74+
75+ ``` bash
76+ $ python bad-python.py
77+ This code does not follow ' pylint' file naming conventions!
78+ This code does not follow ' pycodestyle' coding conventions!
79+ $
80+ ```
81+
82+ These linters flag different things, so it's probably worth running both:
83+
84+ ``` bash
85+ $ pycodestyle * .py
86+ bad-python.py:10:80: E501 line too long (85 > 79 characters)
87+ bad-python.py:12:1: W391 blank line at end of file
88+ $
89+ ```
90+
91+ And:
92+
93+ ``` bash
94+ $ pylint * .py
95+ No config file found, using default configuration
96+ ************* Module bad-python
97+ C: 12, 0: Trailing newlines (trailing-newlines)
98+ C: 1, 0: Module name " bad-python" doesn' t conform to snake_case naming style (invalid-name)
99+ W: 7, 0: String statement has no effect (pointless-string-statement)
100+ W: 10, 0: String statement has no effect (pointless-string-statement)
101+
102+ ---------------------------------------------------------------------
103+ Your code has been rated at 0.00/10 (previous run: -10.00/10, +10.00)
104+
105+ $
106+ ```
107+
69108## pydocstyle
70109
71110While not strictly a linter, having well-formed docstrings allows for the use of automated documentation generators.
0 commit comments