2015-09-18 20:20:48 +03:00
|
|
|
Linters
|
|
|
|
=======
|
|
|
|
|
2015-09-19 00:26:29 +03:00
|
|
|
.. index:: linters
|
2015-09-24 10:38:04 +03:00
|
|
|
|
|
|
|
|
|
|
|
flake8
|
2018-09-15 23:26:13 +03:00
|
|
|
------
|
2015-09-24 10:38:04 +03:00
|
|
|
|
2018-09-15 23:26:13 +03:00
|
|
|
To run flake8: ::
|
2015-09-24 10:38:04 +03:00
|
|
|
|
|
|
|
$ flake8
|
|
|
|
|
|
|
|
The config for flake8 is located in setup.cfg. It specifies:
|
|
|
|
|
|
|
|
* Set max line length to 120 chars
|
2017-05-15 15:01:19 +03:00
|
|
|
* Exclude ``.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules``
|
2015-09-26 10:35:55 +03:00
|
|
|
|
|
|
|
pylint
|
|
|
|
------
|
|
|
|
|
2020-08-14 15:09:36 +03:00
|
|
|
To run pylint: ::
|
2015-09-26 10:35:55 +03:00
|
|
|
|
|
|
|
$ pylint <python files that you wish to lint>
|
|
|
|
|
2015-09-26 10:50:54 +03:00
|
|
|
The config for pylint is located in .pylintrc. It specifies:
|
|
|
|
|
2019-03-23 07:01:23 +03:00
|
|
|
* Use the pylint_django plugin. If using Celery, also use pylint_celery.
|
2015-09-26 10:50:54 +03:00
|
|
|
* Set max line length to 120 chars
|
|
|
|
* Disable linting messages for missing docstring and invalid name
|
|
|
|
* max-parents=13
|
|
|
|
|
2017-09-17 21:56:15 +03:00
|
|
|
pycodestyle
|
2018-09-15 23:26:13 +03:00
|
|
|
-----------
|
2015-09-26 10:35:55 +03:00
|
|
|
|
2018-09-15 23:26:13 +03:00
|
|
|
This is included in flake8's checks, but you can also run it separately to see a more detailed report: ::
|
2015-09-26 10:35:55 +03:00
|
|
|
|
2017-09-17 21:56:15 +03:00
|
|
|
$ pycodestyle <python files that you wish to lint>
|
2015-09-26 10:50:54 +03:00
|
|
|
|
2017-09-17 21:56:15 +03:00
|
|
|
The config for pycodestyle is located in setup.cfg. It specifies:
|
2015-09-26 10:50:54 +03:00
|
|
|
|
|
|
|
* Set max line length to 120 chars
|
2017-05-15 15:01:19 +03:00
|
|
|
* Exclude ``.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules``
|