Skip to content

Commit 6c30024

Browse files
Cimon Lucas (LCM)Cimon Lucas (LCM)
authored andcommitted
Migrating htmlhint & htmllint to pre-commit-hooks-nodejs
1 parent b19f083 commit 6c30024

File tree

7 files changed

+13
-50
lines changed

7 files changed

+13
-50
lines changed

.gitignore

100755100644
File mode changed.

.pre-commit-hooks.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,3 @@
33
entry: validate_html
44
language: python
55
files: .*\.(html|hbs)$
6-
- id: htmlhint
7-
name: NodeJS HTML syntax linter (htmlhint)
8-
entry: htmlhint
9-
language: node
10-
files: .*\.(html|hbs)$
11-
additional_dependencies: ['htmlhint']
12-
- id: htmllint
13-
name: NodeJS HTML syntax linter (htmllint)
14-
entry: htmllint
15-
language: node
16-
files: .*\.(html|hbs)$
17-
additional_dependencies: ['htmllint-cli']

README.md

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,24 @@
1-
[![](https://travis-ci.org/Lucas-C/pre-commit-hooks-html.svg?branch=master)](https://travis-ci.org/Lucas-C/pre-commit-hooks-html)
1+
[![](https://travis-ci.org/Lucas-C/pre-commit-hooks-java.svg?branch=master)](https://travis-ci.org/Lucas-C/pre-commit-hooks-java)
22

3-
Pre-commit hooks to validate HTML5 pages or templates:
3+
Pre-commit hooks requiring a `java` interpreter in the `$PATH`.
44

5-
- one hook uses a regex-based NodeJS linter: https://github.com/yaniswang/HTMLHint
6-
7-
- another one used a [htmlparser2](https://github.com/fb55/htmlparser2)-based NodeJS linter: [htmllint](https://github.com/htmllint/htmllint/wiki/Options)
8-
9-
- the last one uses the v.Nu validator: http://validator.w3.org/nu/.
10-
It requires a `java` interpreter in the `$PATH`.
11-
12-
This last hook can automagically replace mustaches by a default value in order to validate templates.
5+
The `validate-html` hook uses the v.Nu validator: http://validator.w3.org/nu/.
6+
It can automagically replace mustaches by a default value in order to validate templates.
137
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.
148

159
## Usage
16-
17-
For `htmlhint` & `htmllint` (this one require you to have a config file like [this default `.htmllintrc`](https://github.com/htmllint/htmllint-cli/blob/master/lib/default_cfg.json)) :
18-
19-
```
20-
- repo: https://github.com/Lucas-C/pre-commit-hooks-html
21-
sha: v1.3.1
22-
hooks:
23-
- id: htmlhint
24-
# optional custom config:
25-
args: [--config, .htmlhintrc]
26-
- id: htmllint
27-
```
28-
29-
For the W3C v.Nu validator:
30-
3110
```
32-
- repo: https://github.com/Lucas-C/pre-commit-hooks-html
33-
sha: v1.3.1
11+
- repo: https://github.com/Lucas-C/pre-commit-hooks-java
12+
sha: v1.3.6
3413
hooks:
3514
- id: validate-html
3615
```
3716

3817
Advanced usage:
3918

4019
```
41-
- repo: https://github.com/Lucas-C/pre-commit-hooks-html
42-
sha: v1.3.1
20+
- repo: https://github.com/Lucas-C/pre-commit-hooks-java
21+
sha: v1.3.6
4322
hooks:
4423
- id: validate-html
4524
args: [--remove-mustaches, "--ignore=Expected \"<!DOCTYPE html>\""]
@@ -49,8 +28,8 @@ Advanced usage:
4928
With Jinja templates:
5029

5130
```
52-
- repo: https://github.com/Lucas-C/pre-commit-hooks-html
53-
sha: v1.3.1
31+
- repo: https://github.com/Lucas-C/pre-commit-hooks-java
32+
sha: v1.3.6
5433
hooks:
5534
- id: validate-html
5635
args: [--remove-mustaches, --mustache-remover=jinja2]

package.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

pre_commit_hooks/validate_html.py

100755100644
File mode changed.

pytest.ini

100755100644
File mode changed.

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
setup(
55
name='pre-commit-hooks',
6-
description='A pre-commit hook to validate your HTML files / templates against the W3C v.Nu checker',
7-
url='https://github.com/Lucas-C/pre-commit-hooks-html',
8-
version='1.3.5',
6+
description='Pre-commit hooks requiring a Java interpreter in the $PATH',
7+
url='https://github.com/Lucas-C/pre-commit-hooks-java',
8+
version='1.3.6',
99

1010
author='Lucas Cimon',
1111
author_email='lucas.cimon@gmail.com',

0 commit comments

Comments
 (0)