mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-22 19:55:48 +00:00
fixed #197, added test
This commit is contained in:
parent
b750e2d99e
commit
ffec79eedb
2 changed files with 10 additions and 2 deletions
|
|
@ -160,7 +160,7 @@
|
||||||
message: Inline styles should be avoided.
|
message: Inline styles should be avoided.
|
||||||
flags: re.I
|
flags: re.I
|
||||||
patterns:
|
patterns:
|
||||||
- <\w+\s(?:[^>]*\s)?style(?=[^>]*>)
|
- <\w+\s(?:[^>]*\s)?style=(?=[^>]*>)
|
||||||
- rule:
|
- rule:
|
||||||
name: H022
|
name: H022
|
||||||
message: Use HTTPS for external links.
|
message: Use HTTPS for external links.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ run::
|
||||||
|
|
||||||
# for a single test
|
# for a single test
|
||||||
|
|
||||||
pytest tests/test_linter.py::test_T028 --cov=src/djlint --cov-branch \
|
pytest tests/test_linter.py::test_H021 --cov=src/djlint --cov-branch \
|
||||||
--cov-report xml:coverage.xml --cov-report term-missing
|
--cov-report xml:coverage.xml --cov-report term-missing
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
@ -341,6 +341,14 @@ def test_H021(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "H021" not in result.output
|
assert "H021" not in result.output
|
||||||
|
|
||||||
|
write_to_file(
|
||||||
|
tmp_file.name,
|
||||||
|
b'<acronym title="Cascading Style Sheets">CSS</acronym>',
|
||||||
|
)
|
||||||
|
result = runner.invoke(djlint, [tmp_file.name])
|
||||||
|
assert result.exit_code == 0
|
||||||
|
assert "H021" not in result.output
|
||||||
|
|
||||||
|
|
||||||
def test_H022(runner: CliRunner, tmp_file: TextIO) -> None:
|
def test_H022(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||||
write_to_file(tmp_file.name, b'<a href="http://">')
|
write_to_file(tmp_file.name, b'<a href="http://">')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue