lang

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package lang provides language runtime commands (go, dotnet).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBuildSummary

func FormatBuildSummary(s *BuildSummary) string

FormatBuildSummary formats a build summary for display.

func FormatTestSummary

func FormatTestSummary(s *TestSummary) string

FormatTestSummary formats a test summary for display.

Types

type BinlogIssue

type BinlogIssue struct {
	Code    string
	File    string
	Line    int
	Column  int
	Kind    string // "error" or "warning"
	Message string
}

BinlogIssue represents a build error or warning from MSBuild output.

type BuildSummary

type BuildSummary struct {
	Succeeded    bool
	ProjectCount int
	Errors       []BinlogIssue
	Warnings     []BinlogIssue
	DurationText string
}

BuildSummary holds aggregated build results.

func ParseBuildOutput

func ParseBuildOutput(output string) *BuildSummary

ParseBuildOutput parses MSBuild/dotnet build output and extracts errors/warnings.

type FailedTest

type FailedTest struct {
	Name    string
	Message string
	Stack   string
}

FailedTest holds details about a failed test.

type GoTestEvent

type GoTestEvent struct {
	Time    string  `json:"Time"`
	Action  string  `json:"Action"`
	Package string  `json:"Package"`
	Test    string  `json:"Test"`
	Elapsed float64 `json:"Elapsed"`
	Output  string  `json:"Output"`
}

type RSpecExample

type RSpecExample struct {
	ID              string          `json:"id"`
	Description     string          `json:"description"`
	FullDescription string          `json:"full_description"`
	Status          string          `json:"status"`
	FilePath        string          `json:"file_path"`
	LineNumber      int             `json:"line_number"`
	Exception       *RSpecException `json:"exception,omitempty"`
}

type RSpecException

type RSpecException struct {
	Class     string   `json:"class"`
	Message   string   `json:"message"`
	Backtrace []string `json:"backtrace"`
}

type RSpecJSON

type RSpecJSON struct {
	Version  string         `json:"version"`
	Examples []RSpecExample `json:"examples"`
	Summary  RSpecSummary   `json:"summary"`
}

RSpecJSON represents the JSON output from rspec --format json

type RSpecSummary

type RSpecSummary struct {
	Duration     float64 `json:"duration"`
	ExampleCount int     `json:"example_count"`
	FailureCount int     `json:"failure_count"`
	PendingCount int     `json:"pending_count"`
}

type RuboCopFile

type RuboCopFile struct {
	Path     string           `json:"path"`
	Offenses []RuboCopOffense `json:"offenses"`
}

type RuboCopJSON

type RuboCopJSON struct {
	Metadata RuboCopMetadata `json:"metadata"`
	Files    []RuboCopFile   `json:"files"`
	Summary  RuboCopSummary  `json:"summary"`
}

RuboCopJSON represents the JSON output from rubocop --format json

type RuboCopLocation

type RuboCopLocation struct {
	StartLine int `json:"start_line"`
}

type RuboCopMetadata

type RuboCopMetadata struct {
	RuboCopVersion string `json:"rubocop_version"`
}

type RuboCopOffense

type RuboCopOffense struct {
	Severity string          `json:"severity"`
	Message  string          `json:"message"`
	CopName  string          `json:"cop_name"`
	Location RuboCopLocation `json:"location"`
}

type RuboCopSummary

type RuboCopSummary struct {
	OffenseCount       int `json:"offense_count"`
	TargetFileCount    int `json:"target_file_count"`
	InspectedFileCount int `json:"inspected_file_count"`
}

type TRXErrorInfo

type TRXErrorInfo struct {
	XMLName    xml.Name `xml:"ErrorInfo"`
	Message    string   `xml:"Message"`
	StackTrace string   `xml:"StackTrace"`
}

TRXErrorInfo holds error message and stack trace.

type TRXFile

type TRXFile struct {
	XMLName   xml.Name `xml:"TestRun"`
	ID        string   `xml:"id,attr"`
	Name      string   `xml:"name,attr"`
	RunConfig struct {
		XMLName xml.Name `xml:"RunConfiguration"`
	} `xml:"RunConfiguration"`
	Times    TRXTimes   `xml:"Times"`
	Results  TRXResults `xml:"Results"`
	TestDefs struct {
		UnitTests []TRXUnitTest `xml:"UnitTest"`
	} `xml:"TestDefinitions"`
}

TRXFile represents a Visual Studio Test Results XML file.

type TRXOutput

type TRXOutput struct {
	XMLName   xml.Name     `xml:"Output"`
	ErrorInfo TRXErrorInfo `xml:"ErrorInfo"`
	StdOut    string       `xml:"StdOut"`
}

TRXOutput holds test output (error messages, stdout).

type TRXResults

type TRXResults struct {
	XMLName     xml.Name        `xml:"Results"`
	UnitResults []TRXUnitResult `xml:"UnitTestResult"`
}

TRXResults holds unit test results.

type TRXTimes

type TRXTimes struct {
	XMLName  xml.Name `xml:"Times"`
	Creation string   `xml:"creation,attr"`
	Queuing  string   `xml:"queuing,attr"`
	Start    string   `xml:"start,attr"`
	Finish   string   `xml:"finish,attr"`
}

TRXTimes holds start and finish timestamps.

type TRXUnitResult

type TRXUnitResult struct {
	XMLName   xml.Name  `xml:"UnitTestResult"`
	TestID    string    `xml:"testId,attr"`
	TestName  string    `xml:"testName,attr"`
	Outcome   string    `xml:"outcome,attr"`
	Duration  string    `xml:"duration,attr"`
	StartTime string    `xml:"startTime,attr"`
	EndTime   string    `xml:"endTime,attr"`
	Output    TRXOutput `xml:"Output"`
}

TRXUnitResult holds a single test result.

type TRXUnitTest

type TRXUnitTest struct {
	XMLName xml.Name `xml:"UnitTest"`
	ID      string   `xml:"id,attr"`
	Name    string   `xml:"name,attr"`
	Storage string   `xml:"storage,attr"`
}

TRXUnitTest holds test definition metadata.

type TestSummary

type TestSummary struct {
	Total        int
	Passed       int
	Failed       int
	Skipped      int
	FailedTests  []FailedTest
	Duration     time.Duration
	DurationText string
}

TestSummary holds aggregated test results.

func ParseTRXContent

func ParseTRXContent(content string) (*TestSummary, error)

ParseTRXContent parses TRX XML content and returns a summary.

func ParseTRXFile

func ParseTRXFile(path string) (*TestSummary, error)

ParseTRXFile parses a .trx test results file and returns a summary.

func ParseTestOutput

func ParseTestOutput(output string) *TestSummary

ParseTestOutput parses dotnet test output and extracts test results.

Jump to

Keyboard shortcuts

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