kopia lustrzana https://github.com/wagtail/wagtail
Djhtml install and configure with pre-commit (#7940)
rodzic
10833eddd6
commit
72886c0a62
|
@ -24,6 +24,7 @@ jobs:
|
|||
# Filter out known false positives, while preserving normal output and error codes.
|
||||
# See https://github.com/motet-a/jinjalint/issues/18.
|
||||
# And https://circleci.com/docs/2.0/configuration-reference/#default-shell-options.
|
||||
- run: git ls-files '*.html' | xargs pipenv run djhtml --check || true
|
||||
- run:
|
||||
shell: /bin/bash -e
|
||||
command: pipenv run jinjalint --parse-only wagtail | grep -v 'welcome_page.html:6:70' | tee /dev/tty | wc -l | grep -q '0'
|
||||
|
|
|
@ -38,3 +38,7 @@ repos:
|
|||
additional_dependencies:
|
||||
- stylelint@14.2.0
|
||||
- '@wagtail/stylelint-config-wagtail@0.3.2'
|
||||
- repo: https://github.com/rtts/djhtml
|
||||
rev: v1.4.13
|
||||
hooks:
|
||||
- id: djhtml
|
||||
|
|
3
Makefile
3
Makefile
|
@ -3,7 +3,7 @@
|
|||
help:
|
||||
@echo "clean-pyc - remove Python file artifacts"
|
||||
@echo "develop - install development dependencies"
|
||||
@echo "lint - check style with flake8"
|
||||
@echo "lint - check style with flake8, sort python with isort, indent html, and lint frontend css/js"
|
||||
@echo "test - run tests"
|
||||
@echo "coverage - check code coverage"
|
||||
|
||||
|
@ -22,6 +22,7 @@ lint:
|
|||
# Filter out known false positives, while preserving normal output and error codes.
|
||||
# See https://github.com/motet-a/jinjalint/issues/18.
|
||||
jinjalint --parse-only wagtail | grep -v 'welcome_page.html:6:70' | tee /dev/tty | wc -l | grep -q '0'
|
||||
git ls-files '*.html' | xargs djhtml --check
|
||||
npm run lint:css --silent
|
||||
npm run lint:js --silent
|
||||
npm run lint:format --silent
|
||||
|
|
|
@ -6,7 +6,7 @@ We use `Django templates <https://docs.djangoproject.com/en/stable/ref/templates
|
|||
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``.
|
||||
We use `jinjalint <https://github.com/motet-a/jinjalint>`_ to lint templates and `djhtml <https://github.com/rtts/djhtml>`_ to format them. If you have installed Wagtail's testing dependencies (``pip install -e .[testing]``), you can check your code by running ``make lint``.
|
||||
|
||||
Principles
|
||||
~~~~~~~~~~
|
||||
|
|
3
setup.py
3
setup.py
|
@ -66,6 +66,9 @@ testing_extras = [
|
|||
# For templates linting
|
||||
'jinjalint>=0.5',
|
||||
|
||||
# For template indenting
|
||||
'djhtml==1.4.13',
|
||||
|
||||
# Pipenv hack to fix broken dependency causing CircleCI failures
|
||||
'docutils==0.15',
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue