scanner

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Path string
	Ext  string
}

File represents a discovered source file.

func Scan

func Scan(root string, opts Options) ([]File, error)

Scan walks the directory tree and returns source files matching the extensions in opts. Paths are relative to root. Skips skipDirs, generated files (.d.ts, .min.js), and (unless opts.IncludeTests) test files by each language's naming convention. Respects .gitignore if present.

type Options added in v0.2.0

type Options struct {
	// Extensions is the set of file extensions (with leading dot) to collect,
	// e.g. [".go", ".ts", ".tsx"]. It comes from the registered language
	// processors; files with other extensions are skipped.
	Extensions []string
	// IncludeTests keeps test files (e.g. _test.go, *.test.ts, __tests__/) that
	// are skipped by default.
	IncludeTests bool
}

Options controls which files a scan collects.

Jump to

Keyboard shortcuts

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