summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-10 09:26:56 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-11 21:22:07 +0200
commitf1b031589e6c58296cdf73b975c71b10c407bdb3 (patch)
treeaea66328fffbdd9c22d39bddf0fb16248100beb0 /Makefile
parent02f2700d4e3742bacf534c5bd6c4118c66a18aff (diff)
downloadvyos-1x-f1b031589e6c58296cdf73b975c71b10c407bdb3.tar.gz
vyos-1x-f1b031589e6c58296cdf73b975c71b10c407bdb3.zip
T4353: enable linting of Jinja2 templates
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index dc1301100..1abc79ab3 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,8 @@ XDP_DIR := src/xdp
LIBS := -lzmq
CFLAGS :=
+J2LINT := $(shell command -v j2lint 2> /dev/null)
+
config_xml_src = $(wildcard interface-definitions/*.xml.in)
config_xml_obj = $(config_xml_src:.xml.in=.xml)
op_xml_src = $(wildcard op-mode-definitions/*.xml.in)
@@ -75,7 +77,7 @@ vyxdp:
$(MAKE) -C $(XDP_DIR)
.PHONY: all
-all: clean interface_definitions op_mode_definitions vyshim
+all: clean interface_definitions op_mode_definitions test j2lint vyshim
.PHONY: clean
clean:
@@ -90,6 +92,13 @@ test:
set -e; python3 -m compileall -q -x '/vmware-tools/scripts/, /ppp/' .
PYTHONPATH=python/ python3 -m "nose" --with-xunit src --with-coverage --cover-erase --cover-xml --cover-package src/conf_mode,src/op_mode,src/completion,src/helpers,src/validators,src/tests --verbose
+.PHONY: j2lint
+j2lint:
+ifndef J2LINT
+ $(error "j2lint binary not found, consider installing: pip install git+https://github.com/aristanetworks/j2lint.git@341b5d5db86")
+endif
+ $(J2LINT) data/
+
.PHONY: sonar
sonar:
sonar-scanner -X -Dsonar.login=${SONAR_TOKEN}