https://github.com/lucas-c/pre-commit-hooks-java
Pre-commit hooks requiring a Java interpreter in the $PATH
https://github.com/lucas-c/pre-commit-hooks-java
git-hooks handlebars html jinja2 mustaches nu-validator pre-commit python template w3c
Last synced: about 1 month ago
JSON representation
Pre-commit hooks requiring a Java interpreter in the $PATH
- Host: GitHub
- URL: https://github.com/lucas-c/pre-commit-hooks-java
- Owner: Lucas-C
- License: mit
- Created: 2016-11-21T15:25:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-19T07:35:40.000Z (almost 6 years ago)
- Last Synced: 2025-04-05T14:42:08.547Z (about 1 year ago)
- Topics: git-hooks, handlebars, html, jinja2, mustaches, nu-validator, pre-commit, python, template, w3c
- Language: Python
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/Lucas-C/pre-commit-hooks-java)
[Pre-commit](https://pre-commit.com) hooks requiring a `java` interpreter in the `$PATH`.
The `validate-html` hook uses the v.Nu validator: http://validator.w3.org/nu/.
It can automagically replace mustaches by a default value in order to validate templates.
Currently, only [handlebars](http://handlebarsjs.com) templates are supported. Please create an issue if you need support for other template engines: the ones where a Python implementation exist should be easy to add.
## Usage
```
- repo: https://github.com/Lucas-C/pre-commit-hooks-java
sha: 1.3.10
hooks:
- id: validate-html
```
Advanced usage:
```
- repo: https://github.com/Lucas-C/pre-commit-hooks-java
sha: 1.3.10
hooks:
- id: validate-html
args: [--remove-mustaches, "--ignore=Expected \"\""]
files: ^src/main/html/
```
With Jinja templates:
```
- repo: https://github.com/Lucas-C/pre-commit-hooks-java
sha: 1.3.10
hooks:
- id: validate-html
args: [--remove-mustaches, --mustache-remover=jinja2]
```
## [FR] Accessibilité RGAA
Comme ce hook de pre-commit git utilise v.Nu, il permet de valider le critère RGAA3 **1.1 [A] "Chaque image a-t-elle une alternative textuelle ?"** [en employant le validateur HTML5 recommandé par la norme](http://disic.github.io/rgaa_methodologie/).
Si vous souhaitez effectuer d'autres validations automatiques de critères d'accessibilité, jetez un oeil à [WCAG-Zoo](https://wcag-zoo.readthedocs.io)
## Alternatives
- [HTML Tidy](http://www.html-tidy.org) : implemented in C