classify

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 2 Imported by: 0

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

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

func HasInlineRustTests(content []byte) bool

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

func IsBarrelFile(path string) bool

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

func IsIgnorable(path string) bool

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

func IsInitFile(path string) bool

IsInitFile returns true if the path ends with __init__.py.

func IsNonSource

func IsNonSource(path string) bool

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

func IsTestFile(path string) bool

IsTestFile returns true if the path looks like a test file.

func PathBase

func PathBase(path string) string

PathBase returns the filename portion of a path.

func StripGoPlatformSuffix

func StripGoPlatformSuffix(stem string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL