celcheck

package
v0.0.0-...-8e3327d Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package celcheck validates CEL policy packs at compile time.

Ensures that all .cel files parse and type-check correctly using cel-go, so they can be trusted in production.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationResult

type ValidationResult struct {
	File   string   `json:"file"`
	Valid  bool     `json:"valid"`
	Rules  int      `json:"rules"`
	Errors []string `json:"errors,omitempty"`
}

ValidationResult holds the outcome of validating one CEL file.

func ValidateDirectory

func ValidateDirectory(dir string) ([]ValidationResult, error)

ValidateDirectory validates all .cel files in a directory tree.

func ValidateFile

func ValidateFile(path string) ValidationResult

ValidateFile parses and type-checks a CEL policy file.

HELM CEL policy packs use a single compound boolean expression per file, with comment blocks separating logical clauses. We strip comments and blank lines, join the remaining code, and parse the result as one CEL expression.

Jump to

Keyboard shortcuts

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