skillfed

j2lint

Command-line utility that validates jinja2 syntax according to Arista's AVD style guide.

j2lint v1.3.0 115.4K downloads/30d#12,253 on PyPI108
Permissive license MIT Active released

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 j2lint

uv

uv add j2lint

poetry

poetry add j2lint

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Testing

Tags

jinja2 linterjinja2 syntax validatortemplate style checkerjinja2 code qualityavd style guide linterjinja2 formatting rulestemplate lint tool
jinja2lintingci-integration

More Python Modules packages