Browse Source

Configure jinjalint to enforce errors, while filtering-out false positives

Thibaud Colas 5 years ago
parent
commit
d03642dd38
2 changed files with 6 additions and 2 deletions
  1. 3 1
      .circleci/config.yml
  2. 3 1
      Makefile

+ 3 - 1
.circleci/config.yml

@@ -17,7 +17,9 @@ jobs:
           key: pip-package-v1-{{ .Branch }}
       - run: pipenv run flake8 wagtail
       - run: pipenv run isort --check-only --diff --recursive wagtail
-      - run: pipenv run jinjalint --parse-only wagtail || true
+      # Filter out known false positives, while preserving normal output and error codes.
+      # See https://github.com/motet-a/jinjalint/issues/18.
+      - run: pipenv run jinjalint --parse-only wagtail | grep -v 'welcome_page.html:6:70' | tee /dev/tty | wc -l | grep -q '0'
       - run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
 
   frontend:

+ 3 - 1
Makefile

@@ -18,7 +18,9 @@ develop: clean-pyc
 lint:
 	flake8 wagtail
 	isort --check-only --diff --recursive wagtail
-	jinjalint --parse-only wagtail || true
+	# 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'
 	npm run lint:css --silent
 	npm run lint:js --silent