Documentation
¶
Index ¶
- func GetCargoTomlWords(content string) []string
- func GetGoModWords(content string) []string
- func GetIdentifiersFromContent(filename, content string) []string
- func GetImportWordsFromGoFile(filename string) []string
- func GetPackageJSONWords(content string) []string
- func GetPathWords(paths []string) []string
- func GetRequirementsWords(content string) []string
- func MatchFilter(file, filter string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCargoTomlWords ¶ added in v5.6.0
GetCargoTomlWords extracts crate names from dependency sections of Cargo.toml content ([dependencies], [dev-dependencies], and nested variants like [workspace.dependencies]).
func GetGoModWords ¶ added in v5.6.0
GetGoModWords extracts words from module paths in go.mod content: the module line and all require directives (block and single-line).
func GetIdentifiersFromContent ¶ added in v5.5.1
GetIdentifiersFromContent extracts function names, variable names, type names, and other identifiers from code content. It auto-detects the language based on the file extension. For Go files, it uses the go/ast parser for accurate extraction.
func GetPackageJSONWords ¶ added in v5.6.0
GetPackageJSONWords extracts words from the package name and the keys of dependencies and devDependencies. Returns nil on malformed JSON.
func GetPathWords ¶ added in v5.6.0
GetPathWords extracts words from repository path segments: directories, file base names, and extensions.
func GetRequirementsWords ¶ added in v5.6.0
GetRequirementsWords extracts package names from requirements.txt content, skipping comments and pip option lines (-r, -e, --hash, ...).
func MatchFilter ¶
MatchFilter checks if a file matches a filter.
Parameters:
- file: the file to be checked.
- filter: the filter to be matched against the file.
Returns:
- bool: true if the file matches the filter, false otherwise.
- error: an error if there was a problem during the matching process.
Types ¶
This section is empty.