modules

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateSkipIf

func EvaluateSkipIf(s *types.SkipIf, projectRoot string) bool

EvaluateSkipIf returns true if the check should be skipped.

func FindExemption

func FindExemption(filePath, contractID string) (reason string, found bool)

FindExemption scans a file for an inline exemption comment. Matches: // @contract:C-001:exempt:reason text

#  @contract:C-001:exempt:reason text

Types

type Result

type Result = types.Result

Result is an alias for types.Result for package-local convenience.

func CheckCommandAvailable

func CheckCommandAvailable(c *types.CommandAvailCheck) Result

CheckCommandAvailable returns pass if the named binary is found in PATH.

func CheckEnvVar

func CheckEnvVar(c *types.EnvVarCheck) Result

CheckEnvVar returns pass if the named environment variable is set, optionally matching an exact value or regex pattern.

func CheckKeyFile

func CheckKeyFile(path, format string, c *types.KeyCheck) Result

CheckKeyFile checks a key in a YAML, JSON, or TOML file.

func CheckNoEnvVar

func CheckNoEnvVar(c *types.EnvVarCheck) Result

CheckNoEnvVar returns pass if the named environment variable is not set, or is set but does not match the optional pattern.

func CheckNoRegexInFile

func CheckNoRegexInFile(path, pattern string) Result

CheckNoRegexInFile returns pass if pattern does NOT match any content in the file. Patterns are compiled in multiline mode so ^ and $ match line boundaries.

func CheckPathExists

func CheckPathExists(path string, fileType types.PathType) Result

CheckPathExists returns pass if the path exists, optionally asserting file or directory type.

func CheckPathNotExists

func CheckPathNotExists(path string) Result

CheckPathNotExists returns pass if the path does not exist. Returns fail if the path exists or if the stat call fails for an unexpected reason.

func CheckRegexInFile

func CheckRegexInFile(path, pattern string) Result

CheckRegexInFile returns pass if pattern matches any content in the file. Patterns are compiled in multiline mode so ^ and $ match line boundaries.

func RunCommand

func RunCommand(c *types.CommandCheck, cwd string) Result

RunCommand executes a shell command and checks its exit code and optional output.

func RunScript

func RunScript(c *types.ScriptCheck, cwd string) Result

RunScript executes a script from a file path or inline content.

Jump to

Keyboard shortcuts

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