Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing whitespaces for Jinja2 (.j2) files #78

Open
kenorb opened this issue Jan 3, 2021 · 0 comments
Open

Trailing whitespaces for Jinja2 (.j2) files #78

kenorb opened this issue Jan 3, 2021 · 0 comments

Comments

@kenorb
Copy link

kenorb commented Jan 3, 2021

I've a simple file template.j2:

/**
 * @file
 * My file
 */

which doesn't have any trailing whitespace, however the hook reports otherwise in every single line.

I'm using .j2 extension as this is a Jinja2 template. If I change to .j3 it works fine.

$  pre-commit run -a
Check for conflict markers and core.whitespace errors.......................Failed
- hook id: git-check
- exit code: 2

template.j2:1: trailing whitespace.
+/**
template.j2:2: trailing whitespace.
+ * @file
template.j2:3: trailing whitespace.
+ * My file
template.j2:4: trailing whitespace.
+ */

My .pre-commit-config.yaml:

---
repos:
  - repo: https://github.com/jumanjihouse/pre-commit-hooks
    rev: master
    hooks:
      - id: git-check

I've tried to add exclude: '(\.j2)$' but it didn't help.

@kenorb kenorb changed the title Trailing whitespace for .j2 files Trailing whitespaces for Jinja2 (.j2) files Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant