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

option to set tabwidth on pre-commit #67

Closed
JanMalte opened this issue Dec 14, 2022 · 1 comment
Closed

option to set tabwidth on pre-commit #67

JanMalte opened this issue Dec 14, 2022 · 1 comment

Comments

@JanMalte
Copy link

Please provide an option to set the tabwidth for pre-commit usage.

Or even read the .editorconfig

@JaapJoris
Copy link
Member

This is already an option, although admittedly ill-documented.

With pre-commit, you can set a number of options of each hook, including the entry option which contains the command to run. When you look at the default entry points of DjHTML you will see that these commands are djhtml -i, djcss -i and djjs -i. If you want to override that, place the following inside your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/rtts/djhtml
    rev: v1.5.2
    hooks:
      - id: djhtml
        # Use tabwidth 3 for HTML files
        entry: djhtml -i -t 3
      - id: djcss
        # Use tabwidth 5 for CSS files
        entry: djcss -i -t 5
      - id: djjs
        # Use tabwidth 7 for JS files
        entry: djjs -i -t 7

I have added this missing documentation the README, so I will now close this issue. Thank you very much for bringing this to my attention!

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