Returns true if basename is a package manifest we know how to parse. * Used by the filesystem walker; cbm_pkgmap_try_parse is the source of * truth for which basenames produce entries. */
| 1035 | * Used by the filesystem walker; cbm_pkgmap_try_parse is the source of |
| 1036 | * truth for which basenames produce entries. */ |
| 1037 | static bool is_pkgmap_manifest_basename(const char *basename) { |
| 1038 | if (!basename) { |
| 1039 | return false; |
| 1040 | } |
| 1041 | if (strcmp(basename, "package.json") == 0 || strcmp(basename, "go.mod") == 0 || |
| 1042 | strcmp(basename, "Cargo.toml") == 0 || strcmp(basename, "pyproject.toml") == 0 || |
| 1043 | strcmp(basename, "composer.json") == 0 || strcmp(basename, "pubspec.yaml") == 0 || |
| 1044 | strcmp(basename, "pom.xml") == 0 || strcmp(basename, "build.gradle") == 0 || |
| 1045 | strcmp(basename, "build.gradle.kts") == 0 || strcmp(basename, "mix.exs") == 0 || |
| 1046 | strcmp(basename, "Package.swift") == 0) { |
| 1047 | return true; |
| 1048 | } |
| 1049 | return ends_with(basename, ".gemspec"); |
| 1050 | } |
| 1051 | |
| 1052 | /* Stat a path, skipping symlinks. Returns 0 on success, -1 to skip. |
| 1053 | * On POSIX, lstat + S_ISLNK avoids following symlink cycles. On Windows |
no test coverage detected