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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

.jinja extension support? #65

Closed
5h44n opened this issue Jul 27, 2022 · 1 comment
Closed

.jinja extension support? #65

5h44n opened this issue Jul 27, 2022 · 1 comment

Comments

@5h44n
Copy link

5h44n commented Jul 27, 2022

Thanks for this neat hook 馃挴 . Does this detect .jinja files? I tried to specify that extension in the config as shown below but they're getting skipped.

- repo: https://github.com/rtts/djhtml
    rev: v1.5.1
    hooks:
      - id: djhtml
        # Indent only .jinja files in template directories
        files: .*/templates/.*\.jinja$
        args: ["--tabwidth=2"]
      - id: djcss
        # Run this hook only on SCSS files (CSS and SCSS is the default)
        types: [scss]
@JaapJoris
Copy link
Member

Hi there! I think the following pre-commit configuration should work for your use case:

- repo: https://github.com/rtts/djhtml
    rev: v1.5.1
    hooks:
      - id: djhtml
        # Indent only .jinja files in template directories
        types: [file]
        files: .*/templates/.*\.jinja$
        args: ["--tabwidth=2"]
      - id: djcss
        # Run this hook only on SCSS files (CSS and SCSS is the default)
        types: [scss]

Could you try this?

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

2 participants