filter

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const PolicyVersion = "file-scope-v1"

PolicyVersion is part of consumers' result keys. Change it whenever the default file universe changes, even if the annotation format stays the same.

Variables

This section is empty.

Functions

func DefaultExcludePathSegments added in v0.0.11

func DefaultExcludePathSegments() []string

DefaultExcludePathSegments returns an owned copy of the system exclusions. These are directory components, never prefix/glob patterns.

func HasExcludedPathSegment added in v0.0.8

func HasExcludedPathSegment(file string, segments []string) bool

HasExcludedPathSegment reports whether file has any path component that exactly equals one of the given segment names. Backslashes are normalized to slashes; empty components and empty segment entries are ignored.

Types

type LegacyOptions deprecated

type LegacyOptions struct {
	Suffix        []string // include .go
	ExcludeSuffix []string // exclude _test.go

	ExcludePath []string // exclude vendor/
}

Deprecated: use Options instead

func (*LegacyOptions) Match

func (c *LegacyOptions) Match(file string) bool

type Options

type Options struct {
	Suffix        []string // include .go
	ExcludeSuffix []string // exclude _test.go

	Include []string
	Exclude []string

	// ExcludePathSegments drops files whose path has any exact path-component
	// matching a listed name (e.g. "vendor", "node_modules"). Generic checkers
	// use this list verbatim; policy entry points add DefaultExcludePathSegments.
	ExcludePathSegments []string
}

func WithDefaultPathSegments added in v0.0.11

func WithDefaultPathSegments(opts *Options) *Options

WithDefaultPathSegments preserves caller rules and adds the fixed policy.

func (*Options) MatchSuffix

func (c *Options) MatchSuffix(file string) bool

Jump to

Keyboard shortcuts

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