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

Function IsKebabCase

internal/casing/casing.go:78–85  ·  view source on GitHub ↗

IsKebabCase reports whether s is in kebab-case format. kebab-case: only lowercase letters, digits, and hyphens. Examples: "my-feature", "kebab-case", "v2-api".

(s string)

Source from the content-addressed store, hash-verified

76// kebab-case: only lowercase letters, digits, and hyphens.
77// Examples: "my-feature", "kebab-case", "v2-api".
78func IsKebabCase(s string) bool {
79 for _, r := range s {
80 if !unicode.IsLower(r) && !unicode.IsDigit(r) && r != '-' {
81 return false
82 }
83 }
84 return true
85}
86
87// IsPascalCase reports whether s is in PascalCase format.
88// PascalCase: starts with an uppercase letter and contains only letters and

Callers 2

TestIsKebabCaseFunction · 0.92
CheckFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsKebabCaseFunction · 0.74