(header_path: &str, include_line: &str)
| 3147 | } |
| 3148 | |
| 3149 | fn iwyu_classify_header(header_path: &str, include_line: &str) -> &'static str { |
| 3150 | if include_line.contains('<') && include_line.contains('>') { |
| 3151 | return "system"; |
| 3152 | } |
| 3153 | if IWYU_INTERNAL_HEADER_PREFIXES |
| 3154 | .iter() |
| 3155 | .any(|prefix| header_path.starts_with(prefix)) |
| 3156 | { |
| 3157 | return "internal"; |
| 3158 | } |
| 3159 | if !header_path.contains('/') && ends_with_any(header_path, &[".h", ".hpp"]) { |
| 3160 | return "internal"; |
| 3161 | } |
| 3162 | if header_path.starts_with("platforms/") { |
| 3163 | return "platform"; |
| 3164 | } |
| 3165 | "system" |
| 3166 | } |
| 3167 | |
| 3168 | fn iwyu_format_violation(_header_path: &str, header_type: &str, include_line: &str) -> String { |
| 3169 | let type_desc = if header_type == "platform" { |
no test coverage detected