pre-commit-hooks
pre-commit-hooks copied to clipboard
Trailing whitespaces for Jinja2 (.j2) files
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.