Skip to content

Invalid error reporting for text content #175

@vincent-legoll

Description

@vincent-legoll

The following template

# 1st line is a comment {{ 1 + 1 }} containing markup
a line with text containing tab: "	" <= here, but that is not indentation...
  a line indented with spaces
	a line indented with TAB...
{% if True %}reality{% endif %}
{% if False %}disappears{% endif %}
this is the end

is correctly processed by jinja2:

$ j2 /tmp/j2lint_test.j2
# 1st line is a comment 2 containing markup
a line with text containing tab: "	" <= here, but that is not indentation...
  a line indented with spaces
	a line indented with TAB...
reality

this is the end

but not by j2lint:

$ j2lint /tmp/j2lint_test.j2
─────────────────── JINJA2 LINT ERRORS ───────────────────
/tmp/j2lint_test.j2
├── /tmp/j2lint_test.j2:2 Indentation should not use tabulation but 4 spaces (jinja-statements-no-tabs)
├── /tmp/j2lint_test.j2:4 Indentation should not use tabulation but 4 spaces (jinja-statements-no-tabs)
├── /tmp/j2lint_test.j2:5 Jinja statements should be on separate lines (single-statement-per-line)
└── /tmp/j2lint_test.j2:6 Jinja statements should be on separate lines (single-statement-per-line)

Jinja2 linting finished with 4 error(s) and 0 warning(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions