Skip to content

Commit

Permalink
Chore: Create pre-commit-hook (#35)
Browse files Browse the repository at this point in the history
* Create pre-commit-hook
* Update Readme.md

Co-authored-by: Guillaume Mulocher <gmulocher@arista.com>
  • Loading branch information
Shivani-chourasiya and gmuloc authored Jun 8, 2022
1 parent c7e964c commit 619b7c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- id: j2lint
name: Check for Linting error on Jinja2 templates
entry: j2lint
language: python
types: [jinja]
require_serial: true
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ j2lint --help
j2lint --stdin
```

### Using j2lint as a pre-commit-hook

1. Add j2lint pre-commit hook inside your repository in .pre-commit-config.yaml.
```bash
- repo: https://github.com/aristanetworks/j2lint.git
rev: <release_tag/sha>
hooks:
- id: j2lint
```

2. Run pre-commit -> ```pre-commit run --all-files ```

## Acknowledgement

This project is based on [salt-lint](https://github.com/warpnet/salt-lint) and [jinjalint](https://github.com/motet-a/jinjalint)

0 comments on commit 619b7c8

Please sign in to comment.