analysisfs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package analysisfs is the single sanctioned constructor for the filesystem that uda's analyzers walk. It wraps a directory tree so build and vendor directories are pruned before any analyzer sees them, keeping generated and third-party trees out of coupling metrics. Every command builds its analysis fs.FS here so the ignore policy is enforced in one place rather than repeated at each walk site.

The built-in per-language defaults can be extended per repo via an analysis section in .uda.yaml:

analysis:
  exclude: [generated]        # added for every language
  go:
    exclude: [third_party]    # added only when analyzing Go

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfig = errors.New("no analysis configuration")

ErrNoConfig distinguishes "no analysis overrides declared" from a read or parse failure, so callers treat a missing section as defaults-only rather than an error.

Functions

func New

func New(root, language string) fs.FS

New wraps the directory tree at root in an fs.FS that hides build and vendor directories from every walk. When language names a known language the prune set is that language's build dirs; when it is empty or unknown — the multi-language detection path — the prune set is the union across all languages.

Types

type Config

type Config struct {
	Exclude   []string
	Languages map[string]LanguageRules
}

Config is the parsed analysis section of a repo's .uda.yaml. Exclude applies to every language; Languages holds per-language additions keyed by lowercase language name. Both are added on top of the built-in defaults.

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig reads the analysis section from the config file at path. A missing file or missing section returns ErrNoConfig.

type LanguageRules

type LanguageRules struct {
	Exclude []string `yaml:"exclude"`
}

LanguageRules holds the per-language ignore additions.

Jump to

Keyboard shortcuts

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