Documentation
¶
Overview ¶
Package classify provides shared file classification predicates used by both the indexer (to filter non-source edges) and the analyzer (to route files into ignore).
Index ¶
- func ClassifyRole(path string, indegree, outdegree int, isEntrypoint, isUtility bool, ...) string
- func HasInlineRustTests(content []byte) bool
- func IsBarrelFile(path string) bool
- func IsIgnorable(path string) bool
- func IsInitFile(path string) bool
- func IsNonSource(path string) bool
- func IsTestFile(path string) bool
- func PathBase(path string) string
- func StripGoPlatformSuffix(stem string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyRole ¶
func ClassifyRole(path string, indegree, outdegree int, isEntrypoint, isUtility bool, stableThresh int) string
ClassifyRole returns a short role label based on graph signals and path. Returns "" if no specific role can be determined. Priority order: test → barrel → foundation → orchestrator → entrypoint → utility.
func HasInlineRustTests ¶
HasInlineRustTests returns true if the file content contains a #[cfg(test)] inline test module. This is the primary Rust test pattern — most Rust source files contain their tests inline rather than in separate test files.
func IsBarrelFile ¶
IsBarrelFile returns true if the path is a barrel/re-export file. These are index.{ts,tsx,js,jsx,mts,cts,mjs,cjs} and __init__.py.
func IsIgnorable ¶
IsIgnorable returns true if the path is a docs/examples/fixture file that should be excluded from context (regardless of whether the subject is a test).
func IsInitFile ¶
IsInitFile returns true if the path ends with __init__.py.
func IsNonSource ¶
IsNonSource returns true if the path is a test, doc, example, or other non-source file. Non-source files should not contribute to indegree when ranking source files.
func IsTestFile ¶
IsTestFile returns true if the path looks like a test file.
func StripGoPlatformSuffix ¶
StripGoPlatformSuffix removes Go build constraint suffixes (_GOOS, _GOARCH, _GOOS_GOARCH) from a filename stem. Returns the original stem if no platform suffix is found or if stripping would produce an empty string.
Types ¶
This section is empty.