(21:03) cpo lnx01:~/vyos-1x [j2lint] # j2lint data/templates/frr/rpki.frr.tmpl.j2 Jinja2 linting issues found ************ File data/templates/frr/rpki.frr.tmpl.j2 data/templates/frr/rpki.frr.tmpl.j2:5 Bad Indentation, expected 5, got 3 (jinja-statements-indentation) data/templates/frr/rpki.frr.tmpl.j2:7 Bad Indentation, expected 9, got 5 (jinja-statements-indentation) data/templates/frr/rpki.frr.tmpl.j2:9 Bad Indentation, expected 9, got 5 (jinja-statements-indentation) data/templates/frr/rpki.frr.tmpl.j2:11 Bad Indentation, expected 9, got 5 (jinja-statements-indentation) data/templates/frr/rpki.frr.tmpl.j2:12 Bad Indentation, expected 5, got 3 (jinja-statements-indentation)
(21:03) cpo lnx01:~/vyos-1x [j2lint] # vim data/templates/frr/rpki.frr.tmpl.j2 (21:03) cpo lnx01:~/vyos-1x [j2lint] # j2lint data/templates/frr/rpki.frr.tmpl.j2 Linting complete. No problems found.
Every Jinja2 template that should be linted requires to use .j2 file extension over .tmpl (which we currently use) - also indention is 4 spaces (like most of the world is doing - we have 2. Given the fact that our Python code uses indent=4 I am +1 on applying this on the Jinja templates, too
Then every inbound PR can get a linting check for free.
Linter: https://github.com/aristanetworks/j2lint/tree/341b5d5db86e095b622f09770cb6367a1583620e