nanoc-checking-checks-vnu 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -3
- data/lib/nanoc/checking/checks/vnu.rb +15 -4
- data/nanoc-checking-checks-vnu.gemspec +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab798cdcabf1d553a760127aae68cf506db1b9dde12be2abc50f4d525af35bf0
|
4
|
+
data.tar.gz: 141c77ad19ee21d152e5b4cdacff83f60707853e46ecd12f459466fb3eea1621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f4dc1a39d75209d2eb73d325d7955272b49e2c2fd5b6080be5980eeba77802ea4622ac11ad01c66c77618b04c2d4ae1ce0790633050bf843d2c7a7df0735207
|
7
|
+
data.tar.gz: b1f97d40c2a72fd29c0f4ac307c4b33f62e4c357db6cc7dd4928ad47e0b60ace1df13e06e1f74c60687ea01c3ece736a10fbf5b9632dd148499a414057b90e4e
|
data/README.md
CHANGED
@@ -29,15 +29,34 @@ Or install it yourself as:
|
|
29
29
|
Add this line to a Ruby file inside your site's `lib` directory:
|
30
30
|
|
31
31
|
```ruby
|
32
|
-
require 'nanoc
|
32
|
+
require 'nanoc/checking/checks/vnu'
|
33
33
|
```
|
34
34
|
|
35
35
|
Then execute:
|
36
36
|
|
37
37
|
$ nanoc check vnu # prefix with `bundle exec` as appropriate
|
38
38
|
|
39
|
-
You can automatically this check at deploy time by adding `vnu` to
|
40
|
-
`checking` section of `nanoc.yaml`][nanoc-check-deploy].
|
39
|
+
You can automatically run this check at deploy time by adding `vnu` to
|
40
|
+
[the `checking` section of `nanoc.yaml`][nanoc-check-deploy].
|
41
|
+
|
42
|
+
By default, CSS and SVG files are validated in addition to HTML files.
|
43
|
+
This can be changed by configuring the check in `nanoc.yaml`:
|
44
|
+
|
45
|
+
```yaml
|
46
|
+
checks:
|
47
|
+
vnu:
|
48
|
+
also_check_css: no
|
49
|
+
also_check_svg: no
|
50
|
+
```
|
51
|
+
|
52
|
+
You can further disable particular errors by passing a value for the
|
53
|
+
`--filterpattern` option, which takes a regex matching the whole message:
|
54
|
+
|
55
|
+
```yaml
|
56
|
+
checks:
|
57
|
+
vnu:
|
58
|
+
filterpattern: '.*color-mix.*'
|
59
|
+
```
|
41
60
|
|
42
61
|
[nanoc-check-deploy]: https://nanoc.ws/doc/testing/#running-checks-before-deploying
|
43
62
|
|
@@ -5,10 +5,21 @@ module Nanoc
|
|
5
5
|
identifier :vnu
|
6
6
|
|
7
7
|
def run
|
8
|
-
args = ['vnu',
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
args = ['vnu', '--skip-non-html', '--errors-only', '--format', 'json']
|
9
|
+
vnu_config = @config.fetch(:checks, {}).fetch(:vnu, {})
|
10
|
+
if vnu_config.fetch(:also_check_css, true)
|
11
|
+
args << '--also-check-css'
|
12
|
+
end
|
13
|
+
if vnu_config.fetch(:also_check_svg, true)
|
14
|
+
args << '--also-check-svg'
|
15
|
+
end
|
16
|
+
filterpattern = vnu_config.fetch(:filterpattern, nil)
|
17
|
+
if filterpattern
|
18
|
+
args << '--filterpattern'
|
19
|
+
args << filterpattern
|
20
|
+
end
|
21
|
+
args << @config.output_dir
|
22
|
+
|
12
23
|
output = JSON.load(IO.popen(args, err: [:child, :out], &:read))
|
13
24
|
output['messages'].each do |m|
|
14
25
|
add_issue(m['message'], subject: m['url'].sub(/^file:/, ''))
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc-checking-checks-vnu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Que
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-10 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: nanoc-checking
|
@@ -24,7 +23,6 @@ dependencies:
|
|
24
23
|
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: 1.0.0
|
27
|
-
description:
|
28
26
|
email:
|
29
27
|
- git@alerante.net
|
30
28
|
executables: []
|
@@ -44,7 +42,6 @@ licenses:
|
|
44
42
|
metadata:
|
45
43
|
homepage_uri: https://github.com/query/nanoc-checking-checks-vnu
|
46
44
|
source_code_uri: https://github.com/query/nanoc-checking-checks-vnu
|
47
|
-
post_install_message:
|
48
45
|
rdoc_options: []
|
49
46
|
require_paths:
|
50
47
|
- lib
|
@@ -59,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
56
|
- !ruby/object:Gem::Version
|
60
57
|
version: '0'
|
61
58
|
requirements: []
|
62
|
-
rubygems_version: 3.
|
63
|
-
signing_key:
|
59
|
+
rubygems_version: 3.6.2
|
64
60
|
specification_version: 4
|
65
61
|
summary: A nanoc check for validating HTML, CSS, and SVG files with the v.Nu validator.
|
66
62
|
test_files: []
|