File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -507,6 +507,9 @@ impl<'a> FormatLines<'a> {
507
507
508
508
// Iterate over the chars in the file map.
509
509
fn iterate ( & mut self , text : & mut String ) {
510
+ // List of TODO or FIXME issues on the current line
511
+ let mut issues_on_line = Vec :: new ( ) ;
512
+
510
513
for ( kind, c) in CharClasses :: new ( text. chars ( ) ) {
511
514
if c == '\r' {
512
515
continue ;
@@ -515,11 +518,17 @@ impl<'a> FormatLines<'a> {
515
518
if self . allow_issue_seek && self . format_line {
516
519
// Add warnings for bad todos/ fixmes
517
520
if let Some ( issue) = self . issue_seeker . inspect ( c) {
518
- self . push_err ( ErrorKind :: BadIssue ( issue) , false , false ) ;
521
+ issues_on_line . push ( issue) ;
519
522
}
520
523
}
521
524
522
525
if c == '\n' {
526
+ // Accumulate TODO or FIXME issues for the rest of the line so the resulting error
527
+ // messages contain the entire comment line
528
+ for issue in issues_on_line. drain ( ..) {
529
+ self . push_err ( ErrorKind :: BadIssue ( issue) , false , false ) ;
530
+ }
531
+
523
532
self . new_line ( kind) ;
524
533
} else {
525
534
self . char ( c, kind) ;
You can’t perform that action at this time.
0 commit comments