Package org.sonar.plugins.python.indexer
Class SetupPySourceRoots
java.lang.Object
org.sonar.plugins.python.indexer.SetupPySourceRoots
Extracts source root directories from setup.py files.
-
Method Summary
Modifier and TypeMethodDescriptionExtracts source root directories from a setup.py File.static ConfigSourceRootsextractWithLocation(File file) Extracts source root directories from a setup.py File, preserving the config file location.
-
Method Details
-
extract
Extracts source root directories from a setup.py File.- Parameters:
file- the setup.py file- Returns:
- list of source root paths (relative), empty if none found or on parse error
-
extractWithLocation
Extracts source root directories from a setup.py File, preserving the config file location.This method returns a
ConfigSourceRootsthat associates the extracted relative paths with the config file, allowing callers to resolve absolute paths relative to the config file's directory rather than the project base directory.- Parameters:
file- the setup.py file- Returns:
- ConfigSourceRoots containing the config file and its relative source roots
-