Skip to main content

HTML 5 Linter using Mozilla validation services

Project description

Copyright (c) 2018 Andrew Porter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Download-URL: https://github.com/AndrewRPorter/hlint/releases
Description: hlint
=====

**hlint** uses Mozilla's HTML5 Validator instance to lint HTML documents. This project is heavily influenced by mozilla's own linter_.

.. _linter: https://github.com/mozilla/html5-lint

Installation
============

.. code::

pip install hlint

Usage
=====

.. code-block:: python

from hlint import lint

result = lint.check("index.html")
print(result)
assert(result.flag == True)

.. code-block:: python

from hlint import lint

results = lint.check_files(["index.html", "bad.html"])
print(results)
assert(results.total_error_count == 1)

Output
======

.. code::

Error: Bad value for attribute “href” on element “link”: Illegal character in scheme data: space is not allowed.
From line 3, column 6387; to line 3, column 7788
Error: Bad value for attribute “href” on element “link”: Illegal character in scheme data: space is not allowed.
From line 7, column 1; to line 7, column 842
Error: Bad value “1” for attribute “async” on element “script”.
From line 12, column 1; to line 12, column 303
Error: Bad value “toggle” for attribute “rel” on element “a”: The string “toggle” is not a registered keyword.
From line 29, column 121809; to line 29, column 121991
Error: Bad value “1” for attribute “required” on element “input”.
From line 29, column 123986; to line 29, column 124160
Error: Element “input” is missing required attribute “aria-expanded”.
From line 29, column 123986; to line 29, column 124160
Error: Attribute “ajaxify” not allowed on element “a” at this point.
From line 29, column 125356; to line 29, column 125575
Warning: The “name” attribute is obsolete. Consider putting an “id” attribute on the nearest container instead.
From line 29, column 126674; to line 29, column 126859
Error: Attribute “ajaxify” not allowed on element “a” at this point.
Error: The “scrolling” attribute on the “iframe” element is obsolete. Use CSS instead.
From line 29, column 134870; to line 29, column 134973
Error: The “marginheight” attribute on the “iframe” element is obsolete. Use CSS instead.
From line 29, column 134870; to line 29, column 134973
From line 29, column 135584; to line 29, column 135688
Error: The “aria-labelledby” attribute must point to an element in the same document.
From line 29, column 126125; to line 29, column 126258
There were errors. (Tried in the text/html mode.)

License
=======

MIT License

Copyright (c) 2018 Andrew Porter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Platform: UNKNOWN

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hlint-0.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distributions

hlint-0.0.1-py3.5.egg (8.0 kB view details)

Uploaded Source

hlint-0.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file hlint-0.0.1.tar.gz.

File metadata

  • Download URL: hlint-0.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

File hashes

Hashes for hlint-0.0.1.tar.gz
Algorithm Hash digest
SHA256 458e5dcea3299cbebe3e96c3632eea4a1ede13c12c39a762aae544418e86cf8d
MD5 54dbe0f85ad5a9d78e27576abf1c68af
BLAKE2b-256 8c837590757374ac4a2391f75dd2fe2ba273a67a8d5a15154d8d56c17f1d3b9b

See more details on using hashes here.

File details

Details for the file hlint-0.0.1-py3.5.egg.

File metadata

  • Download URL: hlint-0.0.1-py3.5.egg
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

File hashes

Hashes for hlint-0.0.1-py3.5.egg
Algorithm Hash digest
SHA256 6ae7cca73bb700d625d000504c10b714bddbde53222d94374a21cf94759e48a5
MD5 783a604b012ec4bcb42e7b6e28a012ad
BLAKE2b-256 0669f35f2b18fb8530623999bdb7cb54fda0b17e04270fbafa320a7bd7074b62

See more details on using hashes here.

File details

Details for the file hlint-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: hlint-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

File hashes

Hashes for hlint-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acb443c34691ea68ff37911a8c0ad35fd45b25546e8b20dca87ce0af7a474d3c
MD5 0c219dc5db2ec1611db1f8ba9b3ab2cc
BLAKE2b-256 dde331063a8d4838c5bcee60140fbda5338dcd0f132777a52bb60d7c7d741ca3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page