Skip to content

Commit 48f14dc

Browse files
authored
Merge pull request #35 from svenkreiss/ignore-java-env-var-message
ignore a message from JDK about picking up env variables
2 parents a7128be + 9dc6c01 commit 48f14dc

File tree

7 files changed

+85
-12
lines changed

7 files changed

+85
-12
lines changed

README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ Changelog
152152

153153
Install a particular version, for example ``0.1.14``, with ``pip install html5validator==0.1.14``.
154154

155-
* `master <https://github.com/svenkreiss/html5validator/compare/v0.2.7...master>`_
155+
* `master <https://github.com/svenkreiss/html5validator/compare/v0.2.8...master>`_
156+
* `0.2.8 <https://github.com/svenkreiss/html5validator/compare/v0.2.7...v0.2.8>`_ (2017-09-08)
157+
* update vnu jar to 17.9.0
158+
* suppress a warning from the JDK about picked up environment variables
156159
* `0.2.7 <https://github.com/svenkreiss/html5validator/compare/v0.2.5...v0.2.7>`_ (2017-04-09)
157160
* update vnu jar to 17.3.0
158161
* lint Python code

html5validator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Validate HTML5 files."""
22
# flake8: noqa
33

4-
__version__ = "0.2.7"
4+
__version__ = "0.2.8"
55

66
from .validator import Validator, JavaNotFoundException

html5validator/validator.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
LOGGER = logging.getLogger(__name__)
1515

16+
DEFAULT_IGNORE_RE = ['Picked up _JAVA_OPTIONS:.*']
17+
1618

1719
class JavaNotFoundException(Exception):
1820
def __str__(self):
@@ -30,16 +32,17 @@ def __init__(self, directory='.', match='*.html', blacklist=None,
3032
self.ignore = ignore if ignore else []
3133
self.ignore_re = ignore_re if ignore_re else []
3234

35+
# add default ignore_re
36+
self.ignore_re += DEFAULT_IGNORE_RE
37+
3338
# process fancy quotes in ignore
3439
self.ignore = [self._normalize_string(s) for s in self.ignore]
3540
self.ignore_re = [self._normalize_string(s) for s in self.ignore_re]
3641

3742
# Determine jar location.
38-
self.vnu_jar_location = vnujar.__file__.replace(
39-
'__init__.pyc', 'vnu.jar'
40-
).replace(
41-
'__init__.py', 'vnu.jar'
42-
)
43+
self.vnu_jar_location = (vnujar.__file__
44+
.replace('__init__.pyc', 'vnu.jar')
45+
.replace('__init__.py', 'vnu.jar'))
4346
if sys.platform == 'cygwin':
4447
self.vnu_jar_location = self._cygwin_path_convert(
4548
self.vnu_jar_location)
@@ -92,10 +95,10 @@ def validate(self, files=None, errors_only=True, stack_size=None):
9295
raise JavaNotFoundException()
9396

9497
try:
95-
o = subprocess.check_output(['java', '-jar',
96-
self.vnu_jar_location] + opts + files,
97-
stderr=subprocess.STDOUT,
98-
).decode('utf-8')
98+
o = subprocess.check_output(
99+
['java', '-jar', self.vnu_jar_location] + opts + files,
100+
stderr=subprocess.STDOUT,
101+
).decode('utf-8')
99102
except subprocess.CalledProcessError as e:
100103
o = e.output.decode('utf-8')
101104

vnujar/CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@ With a few exceptions, this is a record of mainly just user-facing
22
changes—that is, either changes to the actual behavior of the checker, or
33
changes to any options/interfaces the checker exposes for developers.
44

5+
# 17.9.0
6+
20 August 2017
7+
- Allow script[nomodule]
8+
- Allow the hover, any-hover, pointer, and any-pointer media features
9+
- Allow @scope, @updateviacache, @workertype for link[rel=serviceworker]
10+
- Allow `&;` (don’t report it as “`&` did not start a character reference”)
11+
- Add `acceptlanguage` query parameter, to specify an Accept-Language
12+
request-header value for checker to send when fetching remote documents
13+
- Update CSP checking to Salvation 2.3.0
14+
https://github.com/shapesecurity/salvation/releases/tag/v2.3.0
15+
16+
# 17.7.0
17+
26 June 2017
18+
- Add new major feature to filter out (drop/ignore/suppress) errors/warnings
19+
by regex. See https://github.com/validator/validator/wiki/Message-filtering
20+
- Replace a case of “Attribute "foo" not allowed on element "param" **in this
21+
context**” wording in error message with “Attribute "foo" not allowed on
22+
element "param" **at this point**” (for consistent working for that error
23+
between the command-line checker and the web-based checker).
24+
- Disallow the "contextmenu" attribute and type=contextmenu and type=toolbar
25+
for the `menu` element.
26+
- Allow link[rel=serviceworker]
27+
- Allow floating-point numbers in attribute values to start with decimal point
28+
- Allow a[href] in SVG wherever a[xlink:href] is allowed
29+
- Allow the "focusable" and "tabindex" attributes on SVG elements
30+
- Fix bug that disallowed `progress` & `meter` as label[for] targets
31+
- Default to text/html for checking file uploads
32+
- Emit warnings for use of rel={copyright,previous}
33+
- Prevent Bulgarian ➡ Russian misidentifications in language detector
34+
- Skip figcaption elements when running the language detector
35+
536
# 17.3.0
637
26 March 2017
738
- Allow “color” attribute with link[rel="mask-icon"]

vnujar/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ Use the `vnu.jar` HTML checker as an executable for command-line checking of
6363
documents by invoking it like this:
6464

6565
java -jar ~/vnu.jar [--errors-only] [--exit-zero-always]
66-
[--asciiquotes] [--no-stream] [--format gnu|xml|json|text] [--html]
66+
[--asciiquotes] [--no-stream] [--format gnu|xml|json|text]
67+
[--filterfile FILENAME] [--filterpattern PATTERN] [--html]
6768
[--skip-non-html] [--no-langdetect] [--help] [--verbose] [--version]
6869
FILES
6970

@@ -127,6 +128,22 @@ executable provides the following options:
127128

128129
default: [unset; checker exits 1 if errors are reported for any documents]
129130

131+
#### --filterfile _FILENAME_
132+
133+
Specifies a filename. Each line of the file contains either a regular
134+
expression or starts with "#" to indicate the line is a comment. Any error
135+
message or warning message that matches a regular expression in the file is
136+
filtered out (dropped/suppressed).
137+
138+
default: [unset; checker does no message filtering]
139+
140+
#### --filterpattern _PATTERN_
141+
142+
Specifies a regular-expression pattern. Any error message or warning message
143+
that matches the pattern is filtered out (dropped/suppressed).
144+
145+
default: [unset; checker does no message filtering]
146+
130147
#### --format _format_
131148

132149
Specifies the output format for reporting the results.

vnujar/index.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ <h2>Usage</h2>
195195
<pre>
196196
java -jar ~/vnu.jar [--errors-only] [--exit-zero-always]
197197
[--asciiquotes] [--no-stream] [--format gnu|xml|json|text]
198+
[--filterfile FILENAME] [--filterpattern PATTERN]
198199
[--html] [--skip-non-html] [--no-langdetect]
199200
[--help] [--verbose] [--version] FILES
200201
</pre>
@@ -273,6 +274,24 @@ <h4 id="exit-zero-always">--exit-zero-always</h4>
273274
default: [unset; checker exits 1 if errors are reported for any documents]
274275
</pre>
275276

277+
<h4 id="filterfile">--filterfile <var>FILENAME</var></h4>
278+
<pre>
279+
Specifies a filename. Each line of the file contains either a regular
280+
expression or starts with "#" to indicate the line is a comment. Any error
281+
message or warning message that matches a regular expression in the file is
282+
filtered out (dropped/suppressed).
283+
284+
default: [unset; checker does no message filtering]
285+
</pre>
286+
287+
<h4 id="filterpattern">--filterpattern <var>PATTERN</var></h4>
288+
<pre>
289+
Specifies a regular-expression pattern. Any error message or warning
290+
message that matches the pattern is filtered out (dropped/suppressed).
291+
292+
default: [unset; checker does no message filtering]
293+
</pre>
294+
276295
<h4 id="format">--format <var>format</var></h4>
277296
<pre>
278297
Specifies the output format for reporting the results.

vnujar/vnu.jar

25.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)