j2lint
Command-line utility that validates jinja2 syntax according to Arista's AVD style guide.
What it is and what it does
j2lint is a command-line linter for Jinja2 templates that enforces style and syntax rules defined by Arista's AVD style guide. It checks for common issues like incorrect spacing around variables and operators, improper indentation in nested blocks, inconsistent use of tabs versus spaces, and variable naming conventions (lowercase with underscores for multi-word names). The tool runs as a standalone CLI utility or integrates into CI pipelines and pre-commit hooks.
You use it by pointing it at a directory or file of Jinja2 templates, and it reports violations with configurable output formats (human-readable, JSON, or verbose). You can ignore specific rules globally or per-file, define custom rules, and filter by file extension. It depends on jinja2 for template parsing and rich for formatted terminal output.
Use it for:
- Enforce consistent Jinja2 style across a team's template codebase in CI/CD pipelines.
- Validate template syntax before deployment to catch errors early.
- Integrate into pre-commit hooks to catch style violations before code review.
- Customize linting rules for organization-specific Jinja2 conventions.
- Use as a VSCode extension (or IDE plugin) for real-time template feedback during editing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
j2lint validates Jinja2 template syntax and style against Arista's AVD style guide, enforcing rules for spacing, indentation, naming conventions, and statement formatting.
Yes, if you work with Jinja2 templates and want to enforce consistent style. The tool is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It's particularly valuable in team environments or CI pipelines where style consistency matters. Install it if your project uses Jinja2 and you lack a linting standard.
Install
j2lint on PyPI
pip
pip install j2lintuv
uv add j2lintpoetry
poetry add j2lintInstalling j2lint
Before you install
Low install friction with only two runtime dependencies (jinja2 and rich). Actively maintained with a release 15 days ago; supports Python 3.10 through 3.14.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install j2lint
j2lint /path/to/templates
# With specific rules ignored:
j2lint /path/to/templates --ignore S1 V2
# JSON output for CI:
j2lint /path/to/templates --json
Requires Python 3.10 or later.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — jinja2, rich |
| Maintenance | actively maintained — 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 115,364/month — #12,253 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: j2lint-1.3.0-py3-none-any.whl
Keywords: j2lint, linter, jinja, lint
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
curlylintLints HTML templates in Jinja, Nunjucks,…
permissive · top 15,000 on PyPI
pyavd-utilsProvides Rust-based utility functions for…
permissive · top 15,000 on PyPI
yamllintyamllint checks YAML files for syntax errors,…
copyleft · top 1,000 on PyPI
djlintdjlint formats and lints HTML templates with…
copyleft · top 5,000 on PyPI
j2clij2cli is a command-line tool that renders…
permissive · top 5,000 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
jinjasqlGenerates parameterized SQL queries from Jinja2…
permissive · top 15,000 on PyPI
jinja2_pluralizeProvides Jinja2 template filters for…
permissive · top 15,000 on PyPI
djhtmlDjHTML indents Django and Jinja template files…
copyleft · top 15,000 on PyPI
jinja_partialsAdds a `render_partial()` function to Jinja2…
permissive · top 5,000 on PyPI