starsources

package
v0.1.0-dev.20260307054428 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package starsources holds a captured set of Starlark source files and provides delegation methods for indexing, stats, and analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sources

type Sources struct {
	Root  string   // absolute root directory
	Files []string // absolute paths, sorted
}

Sources holds a captured set of Starlark source files.

func (*Sources) Analyze

Analyze performs a combined analysis of all captured files. Each file is parsed once to extract both complexity and index data.

+devlore:struct_param cfg=staranalysis.AnalysisConfig

func (*Sources) Count

func (s *Sources) Count() int

Count returns the number of captured files.

func (*Sources) Index

func (s *Sources) Index(withDocstrings, withGlobals bool) (*starindex.Index, error)

Index parses all captured files and extracts functions, loads, and globals. If withDocstrings is true, function docstrings are extracted. If withGlobals is true, top-level assignments are captured.

+devlore:defaults withDocstrings=true,withGlobals=true

func (*Sources) Paths

func (s *Sources) Paths() []string

Paths returns the file paths relative to Root.

func (*Sources) Stats

func (s *Sources) Stats(withBytes, withLOC bool) (*starstats.Stats, error)

Stats computes line and byte statistics for all captured files. If withBytes is true, byte counts are included. If withLOC is true, line counts (LOC, SLOC, comments, blanks) are included.

+devlore:defaults withBytes=true,withLOC=true

Jump to

Keyboard shortcuts

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