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

Function IsCamelCase

internal/casing/casing.go:59–73  ·  view source on GitHub ↗

IsCamelCase reports whether s is in camelCase format. camelCase: starts with a lowercase letter and contains only letters and digits (no separators). Examples: "feat", "myFeature", "parseHTML".

(s string)

Source from the content-addressed store, hash-verified

57// camelCase: starts with a lowercase letter and contains only letters and
58// digits (no separators). Examples: "feat", "myFeature", "parseHTML".
59func IsCamelCase(s string) bool {
60 if s == "" {
61 return true
62 }
63 runes := []rune(s)
64 if unicode.IsUpper(runes[0]) {
65 return false
66 }
67 for _, r := range runes {
68 if !unicode.IsLetter(r) && !unicode.IsDigit(r) {
69 return false
70 }
71 }
72 return true
73}
74
75// IsKebabCase reports whether s is in kebab-case format.
76// kebab-case: only lowercase letters, digits, and hyphens.

Callers 2

TestIsCamelCaseFunction · 0.92
CheckFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsCamelCaseFunction · 0.74