kopia lustrzana https://github.com/wagtail/wagtail
Add jinjalint linter for Django templates, allowing errors for now
rodzic
8407245207
commit
a51631c306
|
@ -17,6 +17,7 @@ jobs:
|
||||||
key: pip-package-v1-{{ .Branch }}
|
key: pip-package-v1-{{ .Branch }}
|
||||||
- run: pipenv run flake8 wagtail
|
- run: pipenv run flake8 wagtail
|
||||||
- run: pipenv run isort --check-only --diff --recursive wagtail
|
- run: pipenv run isort --check-only --diff --recursive wagtail
|
||||||
|
- run: pipenv run jinjalint --parse-only wagtail || true
|
||||||
- run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
|
- run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -18,6 +18,7 @@ develop: clean-pyc
|
||||||
lint:
|
lint:
|
||||||
flake8 wagtail
|
flake8 wagtail
|
||||||
isort --check-only --diff --recursive wagtail
|
isort --check-only --diff --recursive wagtail
|
||||||
|
jinjalint --parse-only wagtail || true
|
||||||
npm run lint:css --silent
|
npm run lint:css --silent
|
||||||
npm run lint:js --silent
|
npm run lint:js --silent
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
HTML coding guidelines
|
||||||
|
======================
|
||||||
|
|
||||||
|
We use `Django templates <https://docs.djangoproject.com/en/stable/ref/templates/language/>`_ to author HTML.
|
||||||
|
|
||||||
|
Linting HTML
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
We use `jinjalint <https://github.com/motet-a/jinjalint>`_ to lint templates. If you have installed Wagtail's testing dependencies (``pip install -e .[testing]``), you can check your code by running ``make lint``.
|
||||||
|
|
||||||
|
Principles
|
||||||
|
~~~~~~~~~~
|
||||||
|
|
||||||
|
* Write `valid HTML <https://validator.w3.org/nu/>`_. We target the HTML5 doctype.
|
||||||
|
* Attach JavaScript behavior with ``data-`` attributes, rather than classes or IDs.
|
||||||
|
* For comments, use Django templates syntax instead of HTML.
|
|
@ -60,6 +60,7 @@ More information
|
||||||
styleguide
|
styleguide
|
||||||
general_guidelines
|
general_guidelines
|
||||||
python_guidelines
|
python_guidelines
|
||||||
|
html_guidelines
|
||||||
css_guidelines
|
css_guidelines
|
||||||
javascript_guidelines
|
javascript_guidelines
|
||||||
release_process
|
release_process
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -53,6 +53,9 @@ testing_extras = [
|
||||||
'isort==4.2.5',
|
'isort==4.2.5',
|
||||||
'flake8-blind-except==0.1.1',
|
'flake8-blind-except==0.1.1',
|
||||||
'flake8-print==2.0.2',
|
'flake8-print==2.0.2',
|
||||||
|
|
||||||
|
# For templates linting
|
||||||
|
'jinjalint>=0.5',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Documentation dependencies
|
# Documentation dependencies
|
||||||
|
|
Ładowanie…
Reference in New Issue