starstats

package
v0.1.0-dev.20260310195223 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package starstats computes line and byte statistics for Starlark source files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStats

type FileStats struct {
	Path                        string
	Bytes                       int64
	LOC, SLOC, Comments, Blanks int
}

FileStats holds line and byte statistics for a single file.

type Provider

type Provider struct {
	op.ProviderBase
	Root string
}

Provider computes line and byte statistics for Starlark source files.

+devlore:access=immediate

func (*Provider) ComputeStats

func (p *Provider) ComputeStats(files []string, withBytes, withLOC bool) (*Stats, error)

ComputeStats computes line and byte statistics for the given files. If withBytes is true, byte counts are included. If withLOC is true, line counts (LOC, SLOC, comments, blanks) are included.

type Stats

type Stats struct {
	Files  []FileStats
	Totals StatsTotals
}

Stats holds per-file and aggregate statistics.

type StatsTotals

type StatsTotals struct {
	FileCount                                       int
	TotalBytes                                      int64
	TotalLOC, TotalSLOC, TotalComments, TotalBlanks int
}

StatsTotals aggregates statistics across all files.

Jump to

Keyboard shortcuts

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