mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-29 13:04:05 +03:00
8880e777d2
* Add webpack as an option Adds webpack as a js_taskrunner option to cookiecutter-json. Will clone @hzdg/cookiecutter-webpack --pydanny-django branch into the project using cookiecutter's api in post_hooks. The static webpack project will be placed into the <project_slug>/static/<project_slug>/ directory. The webpack configs are placed in the ./config/ directory. The cookiecutter-webpack project includes react / redux / karma configurations that are brought into the project. * Add webpack documentation
60 lines
1.3 KiB
ReStructuredText
60 lines
1.3 KiB
ReStructuredText
Linters
|
|
=======
|
|
|
|
.. index:: linters
|
|
|
|
|
|
flake8
|
|
-------
|
|
|
|
To run flake8:
|
|
|
|
$ flake8
|
|
|
|
The config for flake8 is located in setup.cfg. It specifies:
|
|
|
|
* Set max line length to 120 chars
|
|
* Exclude .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules
|
|
|
|
pylint
|
|
------
|
|
|
|
This is included in flake8's checks, but you can also run it separately to see a more detailed report:
|
|
|
|
$ pylint <python files that you wish to lint>
|
|
|
|
The config for pylint is located in .pylintrc. It specifies:
|
|
|
|
* Use the pylint_common and pylint_django plugins. If using Celery, also use pylint_celery.
|
|
* Set max line length to 120 chars
|
|
* Disable linting messages for missing docstring and invalid name
|
|
* max-parents=13
|
|
|
|
pep8
|
|
-----
|
|
|
|
This is included in flake8's checks, but you can also run it separately to see a more detailed report:
|
|
|
|
$ pep8 <python files that you wish to lint>
|
|
|
|
The config for pep8 is located in setup.cfg. It specifies:
|
|
|
|
* Set max line length to 120 chars
|
|
* Exclude .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules
|
|
|
|
|
|
eslint
|
|
------
|
|
|
|
If you are using webpack, an ``.eslint`` file will be generated in your project base.
|
|
|
|
Running the karma tests will also run the linter.
|
|
|
|
$ npm test
|
|
|
|
You can manually run the eslint from your project root too:
|
|
|
|
$ eslint <javascript files that you wish to lint>
|
|
|
|
Using the flag ``--fix`` will atomatically fix any errors.
|