mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-16 09:03:09 +00:00
fixed rule E001 for handlbars
This commit is contained in:
parent
41e95ce63b
commit
4f38370225
3 changed files with 12 additions and 2 deletions
|
|
@ -298,10 +298,12 @@ def main(
|
|||
for error in file_errors:
|
||||
error_count += build_output(error)
|
||||
|
||||
success_message = "%sed %s, found %d errors." % (
|
||||
error_case = "error" if error_count == 1 else "errors"
|
||||
success_message = "%sed %s, found %d %s." % (
|
||||
message,
|
||||
file_quantity,
|
||||
error_count,
|
||||
error_case,
|
||||
)
|
||||
|
||||
success_color = Fore.RED + Style.BRIGHT if error_count > 0 else Fore.BLUE
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
- '[^{]{\/[^\s]+|^{\/[^\s]+'
|
||||
- '[^{]{\@[^\s]+|^{\@[^\s]+'
|
||||
# close
|
||||
- '[^\s]+[}|%|#]}'
|
||||
- '[^(\s|^)]+[}|%|#]}'
|
||||
- \s{2,}[}|%|#]}
|
||||
- '{[{|%|#]\s{2,}'
|
||||
- rule:
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ def test_W006(runner, tmp_file):
|
|||
result = runner.invoke(djlint, [tmp_file.name])
|
||||
assert result.exit_code == 0
|
||||
assert "W006 1:" in result.output
|
||||
assert "a" == "b"
|
||||
|
||||
|
||||
def test_W007(runner, tmp_file):
|
||||
|
|
@ -211,6 +212,13 @@ def test_W018(runner, tmp_file):
|
|||
assert "W018 1:" in result.output
|
||||
|
||||
|
||||
def test_handlebars_else(runner, tmp_file):
|
||||
write_to_file(tmp_file.name, b"{{^}}")
|
||||
result = runner.invoke(djlint, [tmp_file.name])
|
||||
assert result.exit_code == 0
|
||||
assert "Linted 1 file, found 0 errors." in result.output
|
||||
|
||||
|
||||
# assert "asdf" in result.output
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue