filesize

package
v0.0.0-...-251f90f Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package filesize checks file sizes against budget rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

Analyzer encapsulates rule evaluation and SARIF emission.

func NewAnalyzer

func NewAnalyzer(rules []Rule) *Analyzer

NewAnalyzer creates an analyzer for the provided rules.

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(paths []string) (*sarif.Log, error)

Analyze walks the provided paths (or "." if empty), evaluates rules, and returns a SARIF log with the findings.

type FileMetric

type FileMetric struct {
	Path      string
	SizeBytes int64
	Lines     *int
}

FileMetric describes a single file's measurements.

type Rule

type Rule struct {
	Pattern  string
	MaxBytes *int64
	MaxLines *int
}

Rule describes a single filesize constraint.

func LoadRules

func LoadRules(path string) ([]Rule, error)

LoadRules reads rules from the provided path. If the path is empty, an empty slice is returned.

Jump to

Keyboard shortcuts

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