| OLD | NEW |
| (Empty) |
| 1 # flake8-eyeo | |
| 2 | |
| 3 A [flake8](https://flake8.readthedocs.io) extension that checks for compliance | |
| 4 with the | |
| 5 [Adblock Plus coding style guide](https://adblockplus.org/coding-style#python) | |
| 6 which is used for all eyeo projects, and some bad practices which flake8 doesn't | |
| 7 handle by default. | |
| 8 | |
| 9 | |
| 10 ## Installation | |
| 11 | |
| 12 Run `python setup.py install`. | |
| 13 | |
| 14 | |
| 15 ## Usage | |
| 16 | |
| 17 Just run `flake8` (you have to install it seperately) on your source files. | |
| 18 After installation the `flake8-eyeo` extension is active by default. | |
| 19 | |
| 20 | |
| 21 ## Warnings | |
| 22 | |
| 23 ### Readability and consistency | |
| 24 | |
| 25 * `A101`: Loop over a tuple or set literal; use lists for data that have order | |
| 26 * `A102`: Membership check on a tuple or list literal; use a set here | |
| 27 * `A103`: Yoda condition | |
| 28 * `A104`: `map()` or `filter()` called with lambda function | |
| 29 * `A105`: Type called with literal or comprehension where a | |
| 30 literal/comprehension of that type can be used directly | |
| 31 * `A106`: Use augment assignment | |
| 32 * `A107`: `%` operator used for string formatting; this mechanism | |
| 33 has been superseded by the string's `format()` method | |
| 34 * `A108`: `+` operator to concatenate more than two strings | |
| 35 * `A110`: Write single-line string literals as represented by `repr()` | |
| 36 * `A111`: Redundant parantheses | |
| 37 * `A112`: Use `from __future__ import unicode_literals` instead of | |
| 38 prefixing literals with "u" | |
| 39 | |
| 40 | |
| 41 ### Redundancy and complexity | |
| 42 | |
| 43 * `A201`: Redundant or superfluos `global` or `nonlocal` declaration | |
| 44 * `A202`: Dead code after block is left | |
| 45 * `A303`: Unused expression | |
| 46 * `A204`: Redundant or superfluos pass statement | |
| 47 * `A205`: Superfluos empty block | |
| 48 * `A206`: Extraneous `else` statement after block is left | |
| 49 * `A207`: Duplicate key in dict or set | |
| 50 | |
| 51 | |
| 52 ### Error-prone practices | |
| 53 | |
| 54 * `A301`: Discouraged APIs | |
| 55 * `A302`: Redefinition of built-in name | |
| 56 * `A303`: Non-default source file encoding | |
| OLD | NEW |