Check if a block contains only comments and whitespace
(block: &str)
| 150 | |
| 151 | /// Check if a block contains only comments and whitespace |
| 152 | fn is_comment_only(block: &str) -> bool { |
| 153 | let lines: Vec<&str> = block.lines().collect(); |
| 154 | |
| 155 | for line in lines { |
| 156 | let trimmed = line.trim(); |
| 157 | if trimmed.is_empty() { |
| 158 | continue; |
| 159 | } |
| 160 | |
| 161 | // Check if line starts with comment markers |
| 162 | if !trimmed.starts_with("--") && !trimmed.starts_with("/*") && !trimmed.starts_with("*") { |
| 163 | return false; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | true |
| 168 | } |
| 169 | |
| 170 | /// Extract annotations from SQL content and return cleaned query |
| 171 | /// Supports @name and @db annotations |
no outgoing calls
no test coverage detected