necramirez / SublimeLinter-contrib-htmllint

This linter plugin for SublimeLinter provides an interface to htmllint.
MIT License
5 stars 3 forks source link

fix(sublimelinter): htmllint(erred) #7

Open Kristinita opened 5 years ago

Kristinita commented 5 years ago

1. Summary

I fix htmllint(erred) for linting big HTML files.

2. Argumentation

3. Data

<!doctype html><html lang="ru"><head><meta charset="utf-8"><title>Поиск Кристиниты</title><meta content="Поисковая система по энциклопедическому содержимому. Поисковик, который ищет авторитетную энциклопедическую информацию по любой тематике. Впитывайте знания, не всякую информацию!" name="description"><meta content="IE=edge" http-equiv="X-UA-Compatible"><meta content="width=device-width,initial-scale=1" name="viewport"><meta content="Поиск Кристиниты" property="og:title"><meta content="website" property="og:type"><meta content="https://kristinita.github.io" property="og:url"><meta content="Поисковик, который ищет авторитетную энциклопедическую информацию по любой тематике. Впитывайте знания, не всякую информацию!" property="og:description"><meta content="Поиск Кристиниты" property="og:site_name"><script type="application/ld+json">{ "@context": "https://schema.org/", "@type": "WebSite", "alternateName": "Kristinita's Search", "description": "Поисковая система по энциклопедическому содержимому. Поисковик, который ищет авторитетную энциклопедическую информацию по любой тематике. Впитывайте знания, не всякую информацию!", "name": "Поиск Кристиниты" }</script><meta content="6389203cb8057dd1b8e6" name="wot-verification"><meta content="eed58073a052abeca0167609b80c6e55" name="wmail-verification"><meta content="5effdd88ab8a818d" name="yandex-verification"><meta content="Xf6irQ5R_zWQGfvB6LMlFqkCEKLmCVN7P5uL2prCs_A" name="google-site-verification"><link href="https://kristinita.github.io/opensearch.xml" rel="search" type="application/opensearchdescription+xml" title="Поиск Кристиниты"><base target="_blank"><script defer src="https://kristinita.github.io/js/personal/Kristinita/gcse.min.js"></script><script defer src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script><script defer src="https://cdn.jsdelivr.net/npm/gemini-scrollbar/index.js"></script><script defer src="https://kristinita.github.io/theme/js/Gemini/gemini-non-scrollbar.min.js"></script><script defer src="https://cdn.jsdelivr.net/npm/bowser/es5.min.js"></script><script defer src="https://kristinita.github.io/js/personal/Kristinita/bowser.min.js"></script><script defer src="https://kristinita.github.io/js/personal/Kristinita/accesskeys.min.js"></script><link href="https://kristinita.github.io/theme/css/general/hide-scrollbar.min.css" rel="stylesheet"><link href="https://kristinita.github.io/theme/css/sections/kristinita.min.css" rel="stylesheet"><link href="https://cdn.jsdelivr.net/npm/gemini-scrollbar/gemini-scrollbar.min.css" rel="stylesheet"><script defer src="https://kristinita.github.io/theme/js/Modernizr/modernizr-custom.min.js"></script><style>.webp body{background:url(https://kristinita.github.io/theme/images/backgrounds/SashaRedLeavesBackground.webp) no-repeat center center/cover fixed}.no-webp body{background:url(https://kristinita.github.io/theme/images/backgrounds/SashaRedLeavesBackground.jpg) no-repeat center center/cover fixed}</style><link href="https://kristinita.github.io/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"><link href="https://kristinita.github.io/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"><link href="https://kristinita.github.io/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"><link href="https://kristinita.github.io/site.webmanifest" rel="manifest"><link href="https://kristinita.github.io/safari-pinned-tab.svg" rel="mask-icon" color="#d55b9a"><link href="https://kristinita.github.io/favicon.ico" rel="shortcut icon"><meta content="Kristinita's Search" name="apple-mobile-web-app-title"><meta content="Kristinita's Search" name="application-name"><meta content="#ffc40d" name="msapplication-TileColor"><meta content="https://kristinita.github.io/mstile-144x144.png" name="msapplication-TileImage"><meta content="https://kristinita.github.io/browserconfig.xml" name="msapplication-config"><meta content="#ffffff" name="theme-color"></head><body><nav><a class="Empress" href="http://cyclowiki.org/wiki/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA%3A%D0%A1%D0%B0%D1%88%D0%B0_%D0%A7%D0%B5%D1%80%D0%BD%D1%8B%D1%85%2F%D0%9F%D0%BE%D0%B8%D1%81%D0%BA_%D0%9A%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BD%D0%B8%D1%82%D1%8B%2F%D0%9A%D0%B0%D1%82%D0%B0%D0%BB%D0%BE%D0%B3_%D0%9A%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BD%D0%B8%D1%82%D1%8B" title="Каталог Кристиниты. Полный список включённых сайтов и некоторые не вошедшие в него.">Каталог</a><a class="Chernykh" href="http://cyclowiki.org/wiki/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA%3A%D0%A1%D0%B0%D1%88%D0%B0_%D0%A7%D0%B5%D1%80%D0%BD%D1%8B%D1%85%2F%D0%9F%D0%BE%D0%B8%D1%81%D0%BA_%D0%9A%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BD%D0%B8%D1%82%D1%8B%2F%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B" title="Обзор сервисов поиска энциклопедической информации и сравнение с ними Поиска Кристиниты">Примеры</a><a class="Sasha" href="http://cyclowiki.org/wiki/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA%3A%D0%A1%D0%B0%D1%88%D0%B0_%D0%A7%D0%B5%D1%80%D0%BD%D1%8B%D1%85%2F%D0%9F%D0%BE%D0%B8%D1%81%D0%BA_%D0%9A%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BD%D0%B8%D1%82%D1%8B" title="Подробный рассказ о Поиске Кристиниты">Описание</a></nav><img alt="Page loading, please, little wait" src="https://2no.co/18mR.png"><br><section class="SashaCenter" role="status"><div class="SashaKristinita">Поиск Кристиниты&nbsp;</div><div class="SashaBeta"><sup>beta</sup></div></section><br><div class="gcse-search" data-autocompletemaxcompletions="10" data-enableautocomplete="true" data-enablehistory="true" data-enableorderby="false"></div><br><div class="SashaMotto"><em><strong>Впитывайте знания,<br>не всякую информацию!</strong></em></div><link href="https://fonts.googleapis.com/css?family=Lora" rel="stylesheet" data-generated="http://enjoycss.com"><br><footer><div class="SashaCopyright">©<a class="SashaVKontakte" href="https://vk.com/hair_in_the_wind">Саша Черных</a>, 2016—9,<a class="SashaVKontakte" href="Pages/Terms-and-Conditions-and-Privacy-Policy.html"><em>Условия использования и политика конфиденциальности</em></a></div></footer><section><div class="SashaBowserFirefox"></div><div class="SashaBowserExplorer"></div></section></body></html>
{
    "debug": false
}

4. Behavior before pull request

Status bar before

SublimeLinter: #1 linter.py:1363      Running …

  D:\SashaDebugging  (working dir)
  > type KiraHtmllint.html | C:\Users\SashaChernykh\AppData\Roaming\npm\htmllint.cmd D:\SashaDebugging\KiraHtmllint.html

SublimeLinter: #1 linter.py:1377      WARNING: Exception: [Errno 32] Broken pipe
SublimeLinter: #1 linter.py:1021      htmllint: no output
SublimeLinter: sublime_linter.py:449  Linting 'KiraHtmllint.html' took 0.74s
D:\SashaDebugging>type KiraHtmllint.html | C:\Users\SashaChernykh\AppData\Roaming\npm\htmllint.cmd D:\SashaDebugging\KiraHtmllint.html

[htmllint] found 0 errors out of 1 files
The process tried to write to a nonexistent pipe.

5. Behavior after pull request

Status bar after

SublimeLinter: #2 linter.py:1363      Running …

  D:\SashaDebugging  (working dir)
  > C:\Users\SashaChernykh\AppData\Roaming\npm\htmllint.cmd D:\SashaDebugging\KiraHtmllint.html

SublimeLinter: #2 linter.py:1027      htmllint: output:
  [htmllint] found 0 errors out of 1 files
SublimeLinter: #2 linter.py:1063      htmllint: No match for line: ''
SublimeLinter: #2 linter.py:1063      htmllint: No match for line: '[htmllint] found 0 errors out of 1 files'
SublimeLinter: sublime_linter.py:449  Linting 'KiraHtmllint.html' took 0.67s
D:\SashaDebugging>C:\Users\SashaChernykh\AppData\Roaming\npm\htmllint.cmd D:\SashaDebugging\KiraHtmllint.html

[htmllint] found 0 errors out of 1 files

6. Additional improvements

I update and remove deprecated syntax for SublimeLinter 4.0:

SublimeLinter: linter.py:376          htmllint: Defining 'cls.syntax' has been deprecated. Use http://www.sublimelinter.com/en/stable/linter_settings.html#selector
SublimeLinter: linter.py:388          htmllint: Defining 'cls.version_args' has no effect anymore. You can safely remove these settings.
SublimeLinter: linter.py:388          htmllint: Defining 'cls.version_re' has no effect anymore. You can safely remove these settings.
SublimeLinter: linter.py:388          htmllint: Defining 'cls.version_requirement' has no effect anymore. You can safely remove these settings.
SublimeLinter: linter.py:388          htmllint: Defining 'cls.npm_name' has no effect anymore. You can safely remove these settings.

7. Testing environment

I test in a version of Sublime Text without plugins and user settings.

Thanks.