Skip to content

Reorganize the Sprig list by category #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 78 additions & 43 deletions pkg/templates/sprig_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,71 +11,106 @@ var (
sprigFuncMap = sprig.FuncMap()

// exportedSprigFunctions lists all of the functions from sprig that will be exposed
// ref: https://masterminds.github.io/sprig/
exportedSprigFunctions = []string{
"add",
"append",
// STRING
"cat",
"concat",
"contains",
"date",
"default",
"dict",
"dig",
"div",
"empty",
"fail",
"fromJson",
"get",
"has",
"hasKey",
"hasPrefix",
"hasSuffix",
"htpasswd",
"join",
"list",
"lower",
"merge",
"mul",
"mustAppend",
"mustFromJson",
"mustHas",
"mustMerge",
"mustPrepend",
"mustRegexFind",
"mustRegexFindAll",
"mustRegexMatch",
"mustSlice",
"mustToDate",
"mustToJson",
"mustToRawJson",
"now",
"prepend",
"quote",
"regexFind",
"regexFindAll",
"regexMatch",
"regexQuoteMeta",
"replace",
"round",
"semver",
"semverCompare",
"set",
"slice",
"substr",
"trim",
"trimAll",
"trunc",
"upper",

// STRING LIST
"concat",
"join",
"split",
"splitn",

// INTEGER MATH
"add",
"div",
"mul",
"round",
"sub",
"substr",
"ternary",

// INTEGER SLICE
"until",
"untilStep",

// FLOAT MATH
// --

// DATE
"date",
"mustToDate",
"now",
"toDate",

// DEFAULTS
"default",
"empty",
"fromJson",
"mustFromJson",
"mustToJson",
"mustToRawJson",
"ternary",
"toJson",
"toRawJson",
"trim",
"trimAll",
"trunc",

// ENCODING
// "b64enc" -- Implemented locally
// "b64dec" -- Implemented locally

// LISTS AND LIST
"append",
"has",
"list",
"mustAppend",
"mustHas",
"mustPrepend",
"prepend",
"mustSlice",
"slice",

// DICTIONARIES AND DICT
"dict",
"dig",
"get",
"hasKey",
"merge",
"mustMerge",
"set",
"unset",
"until",
"untilStep",
"upper",

// TYPE CONVERSION
// "atoi" -- Implemented locally

// PATH AND FILEPATH
// --

// FLOW CONTROL
"fail",

// VERSION COMPARISON
"semver",
"semverCompare",

// CRYPTOGRAPHIC AND SECURITY
"htpasswd",
}
)

Expand Down
Loading