[doc] Add copy pastable yaml about pre-commit in the readme#1117
Open
Pierre-Sassoulas wants to merge 1 commit intodjlint:masterfrom
Open
[doc] Add copy pastable yaml about pre-commit in the readme#1117Pierre-Sassoulas wants to merge 1 commit intodjlint:masterfrom
Pierre-Sassoulas wants to merge 1 commit intodjlint:masterfrom
Conversation
✅ Deploy Preview for djlint canceled.
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds documentation for using djLint with pre-commit hooks to the README. It provides a copy-pastable YAML configuration that users can add to their .pre-commit-config.yaml file to automatically format and check their templates.
- Adds a pre-commit configuration example with two hooks: one for reformatting and one for checking
- Includes helpful comments explaining version usage and where to find additional hook IDs
Comments suppressed due to low confidence (1)
README.md:88
- The version v1.36.4 may not exist or may be outdated. Consider using a more recent version or a placeholder like 'vX.Y.Z' to indicate users should check for the latest version.
rev: v1.36.4 # use latest version instead
| hooks: | ||
| - id: djlint # For an exhaustive list check 'id' in the project's '.pre-commit-hooks.yaml' | ||
| args: ["--reformat"] | ||
| - id: djlint |
There was a problem hiding this comment.
The second djlint hook is missing the args parameter. Since this hook is intended for checking (as mentioned in the description), it should include appropriate arguments or a comment explaining its purpose.
Suggested change
| - id: djlint | |
| - id: djlint | |
| args: ["--check"] |
Author
There was a problem hiding this comment.
Would make sense to be explicit, it's the default value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Would have helped me to jump start instead of doing my own local hook. Chose to do a format then a check because sometime one autoformat is not enough, and the checks were not all done on format AFAIU.