Skip to content

Commit

Permalink
fix(linter): fixed false positive on H037
Browse files Browse the repository at this point in the history
closes #679
  • Loading branch information
christopherpickering committed Jun 2, 2023
1 parent b618f53 commit 3b2e522
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"type": "git",
"url": "git+https://github.com/Riverside-Healthcare/djLint.git"
},
"files": [],
"keywords": [
"html template linter",
"html template formatter",
Expand Down
2 changes: 1 addition & 1 deletion src/djlint/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,4 @@
message: Duplicate attribute found.
flags: re.I
patterns:
- <\w[^>]*?\s\K([a-z-:][a-z-]*?)(?==(?:\"[^\"]*\"|'[^']*'|{{(?:(?!}}).)*}}|{%(?:(?!%}).)*%}|{#(?:(?!#}).)*#}|[^'\">{}])*[^-:]\1=[^>]*?>)
- <\w[^>]*?\s\K([a-z-:][a-z-]*?)(?==(?:\"[^\"]*\"|'[^']*'|{{(?:(?!}}).)*}}|{%(?:(?!%}).)*%}|{#(?:(?!#}).)*#}|[^'\">{}])*[^-:a-z]\1=[^>]*?>)
5 changes: 5 additions & 0 deletions tests/test_linter/test_h037.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
([]),
id="mismatch names",
),
pytest.param(
('<rect x="2" y="3" rx="1" />'),
([]),
id="substring names",
),
pytest.param(
('<svg -width="16" -width="2"></svg>'),
(
Expand Down

0 comments on commit 3b2e522

Please sign in to comment.