File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ jobs:
165
165
WSLENV : FORCE_COLOR:PYTEST_REQPASS:TOXENV:TOX_PARALLEL_NO_SPINNER
166
166
# Number of expected test passes, safety measure for accidental skip of
167
167
# tests. Update value if you add/remove tests.
168
- PYTEST_REQPASS : 694
168
+ PYTEST_REQPASS : 696
169
169
170
170
steps :
171
171
- name : Activate WSL1
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ def in_expression(tokens: list[Any]) -> str:
243
243
if token [1 ] in begin_types :
244
244
avoid_spacing = True
245
245
break
246
- if token [1 ] == "operator" and token [2 ] in (":" , "" ):
246
+ if token [1 ] == "operator" and token [2 ] in (":" , "" , "[" ):
247
247
avoid_spacing = True
248
248
break
249
249
if token [1 ] in ("operator" , "integer" , "string" , "name" ):
@@ -299,7 +299,7 @@ def in_expression(tokens: list[Any]) -> str:
299
299
"(" ,
300
300
):
301
301
tokens .pop ()
302
- elif tokens [- 2 ][2 ] == ": " and in_expression (tokens ) == "[" :
302
+ elif tokens [- 2 ][2 ] != ", " and in_expression (tokens ) == "[" :
303
303
tokens .pop ()
304
304
else :
305
305
if tokens [- 2 ][1 ] == "operator" and tokens [- 2 ][2 ] in ("-" , "+" ):
@@ -525,6 +525,20 @@ def test_jinja_spacing_vars() -> None:
525
525
"spacing" ,
526
526
id = "33" ,
527
527
),
528
+ pytest .param (
529
+ # negative array index
530
+ "{{ foo[-1] }}" ,
531
+ "{{ foo[-1] }}" ,
532
+ "spacing" ,
533
+ id = "34" ,
534
+ ),
535
+ pytest .param (
536
+ # negative array index, repair
537
+ "{{ foo[- 1] }}" ,
538
+ "{{ foo[-1] }}" ,
539
+ "spacing" ,
540
+ id = "35" ,
541
+ ),
528
542
),
529
543
)
530
544
def test_jinja (text : str , expected : str , tag : str ) -> None :
You can’t perform that action at this time.
0 commit comments