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> {
507507
508508 // Iterate over the chars in the file map.
509509 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+
510513 for ( kind, c) in CharClasses :: new ( text. chars ( ) ) {
511514 if c == '\r' {
512515 continue ;
@@ -515,11 +518,17 @@ impl<'a> FormatLines<'a> {
515518 if self . allow_issue_seek && self . format_line {
516519 // Add warnings for bad todos/ fixmes
517520 if let Some ( issue) = self . issue_seeker . inspect ( c) {
518- self . push_err ( ErrorKind :: BadIssue ( issue) , false , false ) ;
521+ issues_on_line . push ( issue) ;
519522 }
520523 }
521524
522525 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+
523532 self . new_line ( kind) ;
524533 } else {
525534 self . char ( c, kind) ;
You can’t perform that action at this time.
0 commit comments