MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / IsSnakeCase

Function IsSnakeCase

internal/casing/casing.go:129–136  ·  view source on GitHub ↗

IsSnakeCase reports whether s is in snake_case format. snake_case: only lowercase letters, digits, and underscores. Examples: "my_feature", "snake_case", "v2_api".

(s string)

Source from the content-addressed store, hash-verified

127// snake_case: only lowercase letters, digits, and underscores.
128// Examples: "my_feature", "snake_case", "v2_api".
129func IsSnakeCase(s string) bool {
130 for _, r := range s {
131 if !unicode.IsLower(r) && !unicode.IsDigit(r) && r != '_' {
132 return false
133 }
134 }
135 return true
136}
137
138// IsStartCase reports whether s is in Start Case format.
139// Start Case: every whitespace-separated word starts with an uppercase letter.

Callers 2

TestIsSnakeCaseFunction · 0.92
CheckFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsSnakeCaseFunction · 0.74