discover

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package discover finds parseable source files in a repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTestFile added in v1.2.0

func IsTestFile(relPath string) bool

IsTestFile reports whether relPath appears to be a test file, based on path conventions that are consistent across major languages:

  • a directory component named test, tests, spec, specs, or __tests__
  • a filename whose base starts with test_, ends with _test or _spec, or contains .test or .spec (handles .test.js, .spec.ts, etc.)

Types

type FileEntry

type FileEntry struct {
	Path     string // Relative to repo root
	Language string
}

FileEntry represents a discovered source file.

func Files

func Files(root string, languages []string) ([]FileEntry, error)

Files discovers parseable source files under root. If languages is non-empty, only files matching one of the listed languages are returned.

Jump to

Keyboard shortcuts

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