| 3493 | } |
| 3494 | |
| 3495 | fn check_file_content(&self, file_content: &FileContent) -> Vec<(usize, String)> { |
| 3496 | let mut violations = Vec::new(); |
| 3497 | let mut in_multiline_comment = false; |
| 3498 | |
| 3499 | for (index, line) in file_content.lines.iter().enumerate() { |
| 3500 | let stripped = line.trim(); |
| 3501 | if line.contains("/*") { |
| 3502 | in_multiline_comment = true; |
| 3503 | } |
| 3504 | if line.contains("*/") { |
| 3505 | in_multiline_comment = false; |
| 3506 | continue; |
| 3507 | } |
| 3508 | if in_multiline_comment || stripped.starts_with("//") { |
| 3509 | continue; |
| 3510 | } |
| 3511 | let code_part = split_line_comment(line); |
| 3512 | if code_part.contains("Serial.printf") { |
| 3513 | violations.push((index + 1, stripped.to_string())); |
| 3514 | } |
| 3515 | } |
| 3516 | |
| 3517 | violations |
| 3518 | } |
| 3519 | } |
| 3520 | |
| 3521 | struct UsingNamespaceFlInExamplesChecker; |