lang

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 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

Overview

Package lang is the one table of the languages Spackle can run code for: which programs a proof may start, the default sandbox image, the compile check after a patch and the command that runs one named test. Every other package reads the table, so adding a language is one entry here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultImages

func DefaultImages() map[string]string

DefaultImages returns the default sandbox image of every language.

func DisplayList

func DisplayList() string

DisplayList names the supported languages for a sentence: "Go, Python, JavaScript and TypeScript".

func Names

func Names() []string

Names returns the supported language names in table order.

func Supported

func Supported(name string) bool

Supported reports whether proofs and fixes are run for the language.

Types

type Proof

type Proof struct {
	// Name is the language name the walk and the mapper use ("go").
	Name string
	// Display is the name as written in prose ("Go").
	Display string
	// DefaultImage is the sandbox image used unless [sandbox.images] names
	// another.
	DefaultImage string
	// Programs lists what a proof's command may start with. There is no
	// shell: a proof is one program run with an argument vector.
	Programs []string
	// contains filtered or unexported fields
}

Proof describes one language with full find, demonstrate and fix support. Other languages get findings and analysis only.

func Lookup

func Lookup(name string) (Proof, bool)

Lookup returns the entry for a language name.

func (Proof) CompileCheck

func (p Proof) CompileCheck(changed []string) []string

CompileCheck returns a cheap command that fails when a changed file no longer compiles or parses, or nil when the language has none for these files. It guards against a "fix" that only stops the proof by breaking the program.

func (Proof) SingleTest

func (p Proof) SingleTest(testCommand, name string) []string

SingleTest returns the command that runs the one test called name. testCommand is the target's own test command as the mapper detected it. The caller validates name: the vector is assembled here and a model never supplies it.

Jump to

Keyboard shortcuts

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