@@ -82,9 +82,31 @@ errors. Run these on code that passes PEP8! |
82 | 82 | The PyCharm IDE has built-in support for Python checking using the *Inspect |
83 | 83 | Code...* tool. The default set of inspections is suitable for use on our code. |
84 | 84 |
|
| 85 | +### Pyflakes |
| 86 | + |
| 87 | +Pyflakes is another pip-installable code analysis tool that focuses on |
| 88 | +identifying coding issues (and less on code layout and formatting). _"Pyflakes |
| 89 | +makes a simple promise: it will never complain about style, and it will try |
| 90 | +very, very hard to never emit false positives."_ |
| 91 | + |
| 92 | +```bash |
| 93 | +pip install pyflakes |
| 94 | + |
| 95 | +pyflakes portal/core/admin.py # Check one file |
| 96 | +pyflakes portal/core # Check all the files in a tree |
| 97 | +``` |
| 98 | + |
| 99 | +Pyflakes has no configuration, and there is no way to suppress a warning by |
| 100 | +adding comments. However, it spots a smaller set of issues than PyLint (for |
| 101 | +example, it doesn't spot unused arguments). This does mean that anything it |
| 102 | +spots is worth checking. |
| 103 | + |
85 | 104 | ### [PyLint](https://docs.pylint.org/) |
86 | 105 |
|
87 | | -PyLint is a Python package for Python source code linting: |
| 106 | +PyLint is a Python package for Python source code linting. It is **extremely** |
| 107 | +thorough, but can also become very slow on large projects. In general, you |
| 108 | +will get acceptable results in much less time by using 'flake8'. If you |
| 109 | +do want to install PyLint: |
88 | 110 |
|
89 | 111 | ```bash |
90 | 112 | pip install pylint |
@@ -126,21 +148,3 @@ Message codes can be found [here](http://pylint-messages.wikidot.com/all-codes). |
126 | 148 | Disable works for the block in which they are found, so include it at the module |
127 | 149 | level to disable a message for a module or file. |
128 | 150 |
|
129 | | -### Pyflakes |
130 | | - |
131 | | -Pyflakes is another pip-installable code analysis tool that focuses on |
132 | | -identifying coding issues (and less on code layout and formatting). _"Pyflakes |
133 | | -makes a simple promise: it will never complain about style, and it will try |
134 | | -very, very hard to never emit false positives."_ |
135 | | - |
136 | | -```bash |
137 | | -pip install pyflakes |
138 | | - |
139 | | -pyflakes portal/core/admin.py # Check one file |
140 | | -pyflakes portal/core # Check all the files in a tree |
141 | | -``` |
142 | | - |
143 | | -Pyflakes has no configuration, and there is no way to suppress a warning by |
144 | | -adding comments. However, it spots a smaller set of issues than PyLint (for |
145 | | -example, it doesn't spot unused arguments). This does mean that anything it |
146 | | -spots is worth checking. |
|