Package org.sonar.plugins.python.indexer
Class PackageRootResolver
java.lang.Object
org.sonar.plugins.python.indexer.PackageRootResolver
Resolves package root directories for Python projects.
This class validates and resolves package roots extracted from build system configurations (e.g., pyproject.toml) and provides fallback resolution when no roots are configured.
-
Method Summary
-
Method Details
-
resolve
public static List<String> resolve(List<String> extractedRoots, org.sonar.api.config.Configuration config, File baseDir) Resolves package root directories.If extracted roots from build system configuration are provided (already as absolute paths resolved relative to their config file locations), returns them directly. Otherwise, applies a fallback chain to determine appropriate roots.
- Parameters:
extractedRoots- roots extracted from build system config, already as absolute pathsconfig- the Sonar configuration to read sonar.sources propertybaseDir- the project base directory (used only for fallback resolution)- Returns:
- list of resolved package root absolute paths
-