configvalidate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package configvalidate checks Codog configuration files and reports fixes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDiagnostics

func FormatDiagnostics(result Result) string

Types

type Diagnostic

type Diagnostic struct {
	Path        string `json:"path"`
	Field       string `json:"field"`
	Line        *int   `json:"line,omitempty"`
	Kind        string `json:"kind"`
	Message     string `json:"message"`
	Expected    string `json:"expected,omitempty"`
	Got         string `json:"got,omitempty"`
	Suggestion  string `json:"suggestion,omitempty"`
	Replacement string `json:"replacement,omitempty"`
}

type FieldType

type FieldType string
const (
	FieldString              FieldType = "string"
	FieldBool                FieldType = "bool"
	FieldObject              FieldType = "object"
	FieldStringArray         FieldType = "string_array"
	FieldHookArray           FieldType = "hook_array"
	FieldNumber              FieldType = "number"
	FieldStringOrStringArray FieldType = "string_or_string_array"
	FieldStringArrayOrMap    FieldType = "string_array_or_map"
	FieldStringMap           FieldType = "string_map"
	FieldRulesImport         FieldType = "rules_import"
)

type Report

type Report struct {
	Kind         string   `json:"kind"`
	Status       string   `json:"status"`
	FileCount    int      `json:"file_count"`
	PresentCount int      `json:"present_count"`
	ErrorCount   int      `json:"error_count"`
	WarningCount int      `json:"warning_count"`
	Paths        []string `json:"paths"`
	Results      []Result `json:"results"`
}

func ValidateFiles

func ValidateFiles(paths []string) Report

type Result

type Result struct {
	Kind         string       `json:"kind"`
	Path         string       `json:"path"`
	Present      bool         `json:"present"`
	Status       string       `json:"status"`
	ErrorCount   int          `json:"error_count"`
	WarningCount int          `json:"warning_count"`
	Errors       []Diagnostic `json:"errors,omitempty"`
	Warnings     []Diagnostic `json:"warnings,omitempty"`
}

func ValidateBytes

func ValidateBytes(data []byte, path string) Result

func ValidateFile

func ValidateFile(path string) Result

Jump to

Keyboard shortcuts

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