isGeneratedFile (src/extraction/generated-detection.ts) — full pattern list ported so future language walkers share it.
(file_path: &str)
| 43 | /// isGeneratedFile (src/extraction/generated-detection.ts) — full pattern list |
| 44 | /// ported so future language walkers share it. |
| 45 | pub fn is_generated_file(file_path: &str) -> bool { |
| 46 | static RES: OnceLock<Vec<Regex>> = OnceLock::new(); |
| 47 | let patterns = RES.get_or_init(|| { |
| 48 | [ |
| 49 | r"\.pb\.go$", |
| 50 | r"\.pulsar\.go$", |
| 51 | r"_grpc\.pb\.go$", |
| 52 | r"_mock\.go$", |
| 53 | r"_mocks\.go$", |
| 54 | r"^mock_[^/]+\.go$", |
| 55 | r"\.generated\.[jt]sx?$", |
| 56 | r"\.gen\.[jt]sx?$", |
| 57 | r"\.pb\.[jt]s$", |
| 58 | r"_pb\.[jt]s$", |
| 59 | r"_grpc_pb\.[jt]s$", |
| 60 | r"[.-]min\.m?js$", |
| 61 | r"_pb2(_grpc)?\.py$", |
| 62 | r"_pb2\.pyi$", |
| 63 | r"\.pb\.(cc|h)$", |
| 64 | r"\.g\.cs$", |
| 65 | r"Grpc\.cs$", |
| 66 | r"OuterClass\.java$", |
| 67 | r"Grpc\.java$", |
| 68 | r"\.pb\.swift$", |
| 69 | r"\.g\.dart$", |
| 70 | r"\.freezed\.dart$", |
| 71 | r"\.pb\.dart$", |
| 72 | r"\.pbgrpc\.dart$", |
| 73 | r"\.chopper\.dart$", |
| 74 | r"\.generated\.rs$", |
| 75 | ] |
| 76 | .iter() |
| 77 | .map(|p| Regex::new(p).expect("generated pattern")) |
| 78 | .collect() |
| 79 | }); |
| 80 | patterns.iter().any(|p| p.is_match(file_path)) |
| 81 | } |
| 82 | |
| 83 | // isMinifiedContent's WEBPACK_RUNTIME (`\b` ASCII, as in JS). |
| 84 | re!(webpack_runtime, r"(?-u:\b)function __webpack_require__\s*\("); |
no test coverage detected