fix(linter): fixed false postive on rule H008

closes #339
This commit is contained in:
Christopher Pickering 2022-08-22 08:49:46 -05:00
parent f9dac86b1a
commit 79618a5bfb
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
3 changed files with 37 additions and 22 deletions

View file

@ -1,47 +1,47 @@
astroid==2.12.2; python_full_version >= "3.7.2" astroid==2.11.7; python_full_version >= "3.7.2"
atomicwrites==1.4.1; python_version >= "3.7" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.4.0" atomicwrites==1.4.0; python_version >= "3.7" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.4.0"
attrs==21.4.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7" attrs==21.4.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
black==22.6.0; python_full_version >= "3.6.2" black==22.1.0; python_full_version >= "3.6.2"
click==8.1.3; python_version >= "3.6" click==8.0.3; python_version >= "3.6"
colorama==0.4.5; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0") colorama==0.4.5; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
coverage==6.4.4; python_version >= "3.7" coverage==6.4.2; python_version >= "3.7"
cssbeautifier==1.14.6 cssbeautifier==1.14.4
dill==0.3.5.1; python_full_version >= "3.7.2" dill==0.3.5.1; python_full_version >= "3.7.2"
editorconfig==0.12.3 editorconfig==0.12.3
execnet==1.9.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" execnet==1.9.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
flake8==4.0.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" flake8==3.9.2; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
html-tag-names==0.1.2; python_version >= "3.7" and python_version < "4.0" html-tag-names==0.1.2; python_version >= "3.7" and python_version < "4.0"
html-void-elements==0.1.0; python_version >= "3.7" and python_version < "4.0" html-void-elements==0.1.0; python_version >= "3.7" and python_version < "4.0"
importlib-metadata==4.12.0; python_version >= "3.7" importlib-metadata==4.11.0; python_version >= "3.7"
iniconfig==1.1.1; python_version >= "3.7" iniconfig==1.1.1; python_version >= "3.7"
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0" isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0"
jsbeautifier==1.14.6 jsbeautifier==1.14.4
lazy-object-proxy==1.7.1; python_version >= "3.6" and python_full_version >= "3.7.2" lazy-object-proxy==1.7.1; python_version >= "3.6" and python_full_version >= "3.7.2"
mccabe==0.7.0; python_full_version >= "3.7.2" mccabe==0.6.1; python_full_version >= "3.7.2"
mypy-extensions==0.4.3; python_full_version >= "3.6.2" and python_version >= "3.6" mypy-extensions==0.4.3; python_full_version >= "3.6.2" and python_version >= "3.6"
mypy==0.971; python_version >= "3.6" mypy==0.971; python_version >= "3.6"
packaging==21.3; python_version >= "3.7" packaging==21.3; python_version >= "3.7"
pathspec==0.9.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0") pathspec==0.9.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
pep8-naming==0.13.2 pep8-naming==0.13.1
platformdirs==2.5.2; python_version >= "3.7" and python_full_version >= "3.7.2" platformdirs==2.5.0; python_version >= "3.7" and python_full_version >= "3.7.2"
pluggy==1.0.0; python_version >= "3.7" pluggy==1.0.0; python_version >= "3.7"
py==1.11.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7" py==1.11.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
pycodestyle==2.9.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" pycodestyle==2.7.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
pyflakes==2.5.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" pyflakes==2.3.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
pylint==2.14.5; python_full_version >= "3.7.2" pylint==2.14.5; python_full_version >= "3.7.2"
pyparsing==3.0.9; python_version >= "3.7" pyparsing==3.0.7; python_version >= "3.7"
pytest-cov==3.0.0; python_version >= "3.6" pytest-cov==3.0.0; python_version >= "3.6"
pytest-forked==1.4.0; python_version >= "3.6" pytest-forked==1.4.0; python_version >= "3.6"
pytest-xdist==2.5.0; python_version >= "3.6" pytest-xdist==2.5.0; python_version >= "3.6"
pytest==7.1.2; python_version >= "3.7" pytest==7.1.2; python_version >= "3.7"
pyyaml==6.0; python_version >= "3.6" pyyaml==6.0; python_version >= "3.6"
regex==2022.8.17 regex==2022.1.18
six==1.16.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" six==1.16.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0"
tomli==2.0.1; python_version >= "3.7" and python_full_version >= "3.7.2" and python_full_version <= "3.11.0a6" and python_version < "3.11" or python_version < "3.11" tomli==2.0.1; python_version >= "3.7" and python_full_version >= "3.7.2" and python_full_version <= "3.11.0a6" and python_version < "3.11" or python_version < "3.11"
tomlkit==0.11.4; python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.7.2" tomlkit==0.11.1; python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.7.2"
tqdm==4.64.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0") tqdm==4.62.3; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
typed-ast==1.5.4; python_version < "3.8" and implementation_name == "cpython" and python_full_version >= "3.7.2" and python_version >= "3.6" typed-ast==1.4.3; python_version < "3.8" and implementation_name == "cpython" and python_full_version >= "3.7.2" and python_version >= "3.6"
types-pyyaml==6.0.11 types-pyyaml==6.0.11
typing-extensions==4.3.0; python_version < "3.8" and python_version >= "3.7" and python_full_version >= "3.7.2" typing-extensions==4.1.0; python_version < "3.8" and python_version >= "3.7" and python_full_version >= "3.7.2"
wrapt==1.14.1; python_full_version >= "3.7.2" wrapt==1.14.1; python_full_version >= "3.7.2"
zipp==3.8.1; python_version < "3.8" and python_version >= "3.7" zipp==3.7.0; python_version < "3.8" and python_version >= "3.7"

View file

@ -70,7 +70,7 @@
message: Attributes should be double quoted. message: Attributes should be double quoted.
flags: re.DOTALL|re.I flags: re.DOTALL|re.I
patterns: patterns:
- (?:class|id|src|width|height|alt|style|lang|title|srcset|media)=\'[^\']*' - <(?:\w+)\b(\"[^\"]*\"|'[^']*'|{[^}]*}|[^'\">{}])*(?:class|id|src|width|height|alt|style|lang|title|srcset|media)=\'[^\']*'
- rule: - rule:
name: H009 name: H009
message: Tag names should be lowercase. message: Tag names should be lowercase.

View file

@ -105,6 +105,21 @@ def test_H008(runner: CliRunner, tmp_file: TextIO) -> None:
assert result.exit_code == 1 assert result.exit_code == 1
assert "H008 1:" in result.output assert "H008 1:" in result.output
write_to_file(
tmp_file.name,
b"""<link rel="stylesheet" href="KiraCSS.css" media="print" onload="this.media='all'" media=''/>""",
)
result = runner.invoke(djlint, [tmp_file.name])
assert result.exit_code == 1
assert "H008 1:" in result.output
write_to_file(
tmp_file.name,
b"""<link rel="stylesheet" href="KiraCSS.css" media="print" onload="this.media='all'"/>""",
)
result = runner.invoke(djlint, [tmp_file.name])
assert "H008 1:" not in result.output
def test_H009(runner: CliRunner, tmp_file: TextIO) -> None: def test_H009(runner: CliRunner, tmp_file: TextIO) -> None:
write_to_file(tmp_file.name, b"<H1>") write_to_file(tmp_file.name, b"<H1>")