Normalize file path for comparison
(file_path: str)
| 1036 | |
| 1037 | |
| 1038 | def _normalize_file_path(file_path: str) -> str: |
| 1039 | """Normalize file path for comparison""" |
| 1040 | # Remove leading/trailing slashes and convert to lowercase |
| 1041 | normalized = file_path.strip("/").lower() |
| 1042 | # Replace backslashes with forward slashes |
| 1043 | normalized = normalized.replace("\\", "/") |
| 1044 | |
| 1045 | # Remove common prefixes to make matching more flexible |
| 1046 | common_prefixes = ["src/", "./src/", "./", "core/", "lib/", "main/"] |
| 1047 | for prefix in common_prefixes: |
| 1048 | if normalized.startswith(prefix): |
| 1049 | normalized = normalized[len(prefix) :] |
| 1050 | break |
| 1051 | |
| 1052 | return normalized |
| 1053 | |
| 1054 | |
| 1055 | def _paths_match( |
no outgoing calls
no test coverage detected