|
1 | 1 | [](https://api.reuse.software/info/github.com/SAP/pylint-per-file-ignores) |
2 | 2 |
|
3 | 3 |
|
4 | | -# Pylint Per File Ignores 😲 |
5 | | - |
| 4 | +# Pylint Per File Ignores |
6 | 5 | This pylint plugin will enable per-file-ignores in your project! |
7 | 6 |
|
8 | | -The project was initaly created by [christopherpickering](https://github.com/christopherpickering). |
9 | | -Please stay tuned for fixes, feature, etc. in the next months but please give me some time to board on :). |
| 7 | +The project was initially created by [christopherpickering](https://github.com/christopherpickering). |
10 | 8 |
|
11 | 9 | ## Install |
12 | | - |
13 | 10 | ``` |
14 | | -# w/ poetry |
15 | | -poetry add pylint-per-file-ignores --group dev |
16 | | -
|
17 | | -# w/ pip |
18 | 11 | pip install pylint-per-file-ignores |
19 | 12 | ``` |
20 | 13 |
|
21 | 14 | ## Add to Pylint Settings |
22 | | - |
23 | 15 | ```toml |
24 | | -[tool.pylint.MASTER] |
| 16 | +[tool.pylint.main] |
25 | 17 | load-plugins=[ |
26 | 18 | "pylint_per_file_ignores", |
27 | 19 | ... |
28 | 20 | ] |
29 | 21 | ``` |
30 | 22 |
|
31 | | - |
32 | 23 | ## Usage |
33 | | - |
34 | 24 | Add list of patterns and codes you would like to ignore. |
| 25 | +The patterns are matched using `globs`. |
35 | 26 |
|
36 | | -### Using native pylint settings |
37 | | - |
38 | | -Section "MESSAGES CONTROL". Examples: |
39 | | - |
| 27 | +**.pylintrc** |
40 | 28 | ```ini |
41 | | -# .pylintrc |
42 | | - |
43 | 29 | [MESSAGES CONTROL] |
44 | 30 | per-file-ignores = |
45 | | - .*_test\.py:protected-access # ignore "protected-access" errors in test files ending in "_test.py" |
| 31 | + /folder_1/:missing-function-docstring,W0621,W0240,C0115 |
| 32 | + file.py:C0116,E0001 |
46 | 33 | ``` |
47 | 34 |
|
| 35 | +**setup.cfg** |
48 | 36 | ```ini |
49 | | -# setup.cfg |
50 | | - |
51 | 37 | [pylint.MESSAGES CONTROL] |
52 | 38 | per-file-ignores = |
53 | 39 | /folder_1/:missing-function-docstring,W0621,W0240,C0115 |
54 | 40 | file.py:C0116,E0001 |
55 | 41 | ``` |
56 | 42 |
|
| 43 | +**pyproject.toml** |
57 | 44 | ```toml |
58 | | -# pyproject.toml |
59 | | - |
60 | 45 | [tool.pylint.'messages control'] |
61 | 46 | per-file-ignores = [ |
62 | 47 | "/folder_1/:missing-function-docstring,W0621,W0240,C0115", |
63 | 48 | "file.py:C0116,E0001" |
64 | 49 | ] |
65 | 50 | ``` |
66 | 51 |
|
67 | | -### Using custom `pyproject.toml` section |
68 | | - |
69 | | -For backwards compatibility only. Example: |
70 | | - |
71 | | -```toml |
72 | | -[tool.pylint-per-file-ignores] |
73 | | -"/folder_1/"="missing-function-docstring,W0621,W0240,C0115" |
74 | | -"file.py"="C0116,E0001" |
75 | | -``` |
76 | | - |
77 | | -## Thanks |
| 52 | +## Build and Publish |
78 | 53 |
|
79 | | -To pylint :) And the plugin `pylint-django` who produced most of the complex code. |
| 54 | +This project uses `setuptools` as the dependency management and build tool. |
| 55 | +To publish a new release, follow these steps: |
| 56 | +* Update the version in the `pyproject.toml` |
| 57 | +* Add an entry in the changelog |
| 58 | +* Push a new tag like `vX.X.X` to trigger the release |
80 | 59 |
|
81 | 60 | ## Support, Feedback, Contributing |
82 | 61 |
|
|
0 commit comments