Skip to content

Commit bfdd17d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3f32ddc commit bfdd17d

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

DEPRECATION_REMOVAL_v5.2.7.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TagSpecs v0.4.0 Deprecation Removal Checklist
22

3-
**Target Version:** v5.2.7
3+
**Target Version:** v5.2.7
44
**Timeline:** Remove after v5.2.5 and v5.2.6 releases
55

66
This document provides a step-by-step checklist for removing the deprecated TagSpecs v0.4.0 format support.
@@ -57,9 +57,9 @@ This document provides a step-by-step checklist for removing the deprecated TagS
5757
- [ ] Add removal notice to CHANGELOG.md under v5.2.7:
5858
```markdown
5959
## [5.2.7]
60-
60+
6161
### Removed
62-
62+
6363
- TagSpecs v0.4.0 flat format support (deprecated in v5.2.5)
6464
```
6565

crates/djls-semantic/src/semantic/args.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ fn validate_choices_and_order(
214214
// - We hit the next literal keyword
215215
// - We hit the end of bits
216216
// - We've consumed at least one token
217-
217+
218218
let start_index = bit_index;
219219
let next_literal = find_next_literal(&args[arg_index + 1..]);
220-
220+
221221
// Consume tokens greedily until we hit a known literal
222222
while bit_index < bits.len() {
223223
if let Some(ref lit) = next_literal {
@@ -227,7 +227,7 @@ fn validate_choices_and_order(
227227
}
228228
bit_index += 1;
229229
}
230-
230+
231231
// Must consume at least one token for expression
232232
if bit_index == start_index {
233233
bit_index += 1;
@@ -238,24 +238,24 @@ fn validate_choices_and_order(
238238
// 1. Single token with = (e.g., "total=value")
239239
// 2. Multiple tokens with "as" keyword (e.g., "url 'name' as varname")
240240
// For now, consume until we find pattern or reach next literal
241-
241+
242242
let next_literal = find_next_literal(&args[arg_index + 1..]);
243-
243+
244244
while bit_index < bits.len() {
245245
let token = &bits[bit_index];
246246
bit_index += 1;
247-
247+
248248
// If token contains =, we're done with this assignment
249249
if token.contains('=') {
250250
break;
251251
}
252-
252+
253253
// If we hit "as", consume one more token (the variable name)
254254
if token == "as" && bit_index < bits.len() {
255255
bit_index += 1;
256256
break;
257257
}
258-
258+
259259
// Stop if we hit next literal
260260
if let Some(ref lit) = next_literal {
261261
if token == lit {
@@ -319,7 +319,7 @@ mod tests {
319319
// Helper to manually validate arguments without full database setup
320320
fn validate_args_simple(bits: Vec<String>, args: Vec<TagArg>) -> Vec<String> {
321321
let mut errors = Vec::new();
322-
322+
323323
let has_varargs = args.iter().any(|arg| matches!(arg, TagArg::VarArgs { .. }));
324324
let required_count = args.iter().filter(|arg| arg.is_required()).count();
325325

@@ -361,7 +361,7 @@ mod tests {
361361
TagArg::Expr { .. } => {
362362
let start_index = bit_index;
363363
let next_literal = find_next_literal(&args[arg_index + 1..]);
364-
364+
365365
while bit_index < bits.len() {
366366
if let Some(ref lit) = next_literal {
367367
if bits[bit_index] == *lit {
@@ -370,27 +370,27 @@ mod tests {
370370
}
371371
bit_index += 1;
372372
}
373-
373+
374374
if bit_index == start_index {
375375
bit_index += 1;
376376
}
377377
}
378378
TagArg::Assignment { .. } => {
379379
let next_literal = find_next_literal(&args[arg_index + 1..]);
380-
380+
381381
while bit_index < bits.len() {
382382
let token = &bits[bit_index];
383383
bit_index += 1;
384-
384+
385385
if token.contains('=') {
386386
break;
387387
}
388-
388+
389389
if token == "as" && bit_index < bits.len() {
390390
bit_index += 1;
391391
break;
392392
}
393-
393+
394394
if let Some(ref lit) = next_literal {
395395
if token == lit {
396396
break;
@@ -426,7 +426,7 @@ mod tests {
426426
name: "condition".into(),
427427
required: true,
428428
}];
429-
429+
430430
let errors = validate_args_simple(bits, args);
431431
assert!(errors.is_empty(), "Should not error on expression with multiple tokens: {:?}", errors);
432432
}
@@ -440,7 +440,7 @@ mod tests {
440440
name: "message".into(),
441441
required: true,
442442
}];
443-
443+
444444
let errors = validate_args_simple(bits, args);
445445
assert!(errors.is_empty(), "Should not error on quoted string: {:?}", errors);
446446
}
@@ -472,7 +472,7 @@ mod tests {
472472
required: false,
473473
},
474474
];
475-
475+
476476
let errors = validate_args_simple(bits, args);
477477
assert!(errors.is_empty(), "Should handle optional literal 'reversed': {:?}", errors);
478478
}
@@ -489,7 +489,7 @@ mod tests {
489489
name: "condition".into(),
490490
required: true,
491491
}];
492-
492+
493493
let errors = validate_args_simple(bits, args);
494494
assert!(errors.is_empty(), "Should handle complex boolean expression: {:?}", errors);
495495
}
@@ -513,7 +513,7 @@ mod tests {
513513
required: false,
514514
},
515515
];
516-
516+
517517
let errors = validate_args_simple(bits, args);
518518
assert!(errors.is_empty(), "Should handle varargs: {:?}", errors);
519519
}
@@ -526,7 +526,7 @@ mod tests {
526526
name: "bindings".into(),
527527
required: true,
528528
}];
529-
529+
530530
let errors = validate_args_simple(bits, args);
531531
assert!(errors.is_empty(), "Should handle assignment with filter: {:?}", errors);
532532
}
@@ -539,7 +539,7 @@ mod tests {
539539
name: "template".into(),
540540
required: true,
541541
}];
542-
542+
543543
let errors = validate_args_simple(bits, args);
544544
assert!(errors.is_empty(), "Should handle quoted path: {:?}", errors);
545545
}
@@ -558,7 +558,7 @@ mod tests {
558558
required: false,
559559
},
560560
];
561-
561+
562562
let errors = validate_args_simple(bits, args);
563563
assert!(errors.is_empty(), "Expr should stop before literal keyword: {:?}", errors);
564564
}

crates/djls-templates/src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::nodelist::Node;
66
use crate::tokens::Token;
77

88
/// Tokenize tag content respecting quoted strings.
9-
///
9+
///
1010
/// Splits on whitespace but keeps quoted strings as single tokens.
1111
/// Handles both single and double quotes, and escaped quotes within strings.
1212
fn tokenize_tag_content(content: &str) -> Vec<String> {
@@ -147,7 +147,7 @@ impl Parser {
147147
};
148148

149149
let tokens = tokenize_tag_content(content_ref);
150-
150+
151151
let mut iter = tokens.into_iter();
152152
let name = iter.next().ok_or(ParseError::EmptyTag)?;
153153
let bits: Vec<String> = iter.collect();

0 commit comments

Comments
 (0)