scanner

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package scanner provides file discovery and language detection for TestGen.

Index

Constants

View Source
const (
	LangGo         = "go"
	LangPython     = "python"
	LangJavaScript = "javascript"
	LangTypeScript = "typescript"
	LangRust       = "rust"
	LangJava       = "java"
)

Language constants

Variables

This section is empty.

Functions

func DetectLanguage

func DetectLanguage(filePath string) string

DetectLanguage determines the programming language from a file path

func GetLanguagesForExtension

func GetLanguagesForExtension(ext string) []string

GetLanguagesForExtension returns languages that use the given extension

func GetSupportedExtensions

func GetSupportedExtensions() []string

GetSupportedExtensions returns all supported file extensions

func IsJavaScriptFamily

func IsJavaScriptFamily(lang string) bool

IsJavaScriptFamily returns true if the language is JS or TS

func NormalizeLanguage

func NormalizeLanguage(lang string) string

NormalizeLanguage converts language aliases to standard names

Types

type Options

type Options struct {
	Recursive      bool
	IncludePattern string
	ExcludePattern string
	IgnoreFile     string // Path to .testgenignore
}

Options configures the scanner behavior

type Scanner

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

Scanner discovers and filters source files

func New

func New(opts Options) *Scanner

New creates a new Scanner with the given options

func (*Scanner) Scan

func (s *Scanner) Scan(rootPath string) ([]*SourceFile, error)

Scan discovers source files in the given path

type SourceFile

type SourceFile = models.SourceFile

SourceFile is an alias for the models.SourceFile for package-local use

Jump to

Keyboard shortcuts

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