language

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package language contains configuration structures and helpers for language definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLanguageConfigFile

func NewLanguageConfigFile(path string) error

NewLanguageConfigFile Creates the project file locally

func Schema

func Schema() *jsonschema.Schema

Schema is used to generate a complete jsonschema for the Languages struct

Types

type Language

type Language struct {
	FileMatch *Regex `` /* 200-byte string literal not displayed */
	Fmt       Linter `json:"fmt,omitempty" yaml:"fmt,omitempty" jsonschema_description:"used for the given language when formatting"`
	Chk       Linter `json:"chk,omitempty" yaml:"chk,omitempty" jsonschema_description:"used for the given language when linting/checking"`
}

Language is used to map customer yaml decoders for implementations of Crie linters

func (Language) ToCrieLanguage

func (l Language) ToCrieLanguage() (*runner.Language, error)

ToCrieLanguage will convert the yaml friendly version to an internal representation used by crie

type Languages

type Languages struct {
	Languages map[string]Language `json:"languages" yaml:"languages" jsonschema_description:"a map of languages that crie should be able to run"`
}

Languages is the schema for a projects' project file

func LoadFile

func LoadFile(path string) (*Languages, error)

LoadFile will attempt to parse a Language schema compatible file and use it to overwrite the builtin defaults

type Linter

type Linter struct {
	linter.Linter
}

Linter attaches a type discriminator field to make a Crie Linter implementation yaml parsable

func (Linter) JSONSchema

func (l Linter) JSONSchema() *jsonschema.Schema

JSONSchema is used to parse a valid jsonschema just for a Linter

func (*Linter) UnmarshalYAML

func (l *Linter) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements custom YAML unmarshalling

type Regex

type Regex struct {
	*regexp.Regexp
}

Regex wraps regexp.Regexp with custom YAML unmarshaling

func (*Regex) UnmarshalYAML

func (cr *Regex) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements custom YAML unmarshalling

Jump to

Keyboard shortcuts

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