-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommit_types.go
More file actions
58 lines (54 loc) · 1.91 KB
/
commit_types.go
File metadata and controls
58 lines (54 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import "strings"
// CommitType represents a commit type with metadata
type CommitType struct {
Name string
Short string
Emoji string
DisplayName string
}
var commitTypes = []CommitType{
{"feature", "feat", "🚀", "Feature"},
{"fix", "bug", "🐛", "Bugfix"},
{"chore", "chore", "🔧", "Chore"},
{"documentation", "docs", "📚", "Documentation"},
{"refactor", "refactor", "♻️", "Refactor"},
{"test", "test", "🧪", "Test"},
{"perf", "perf", "⚡", "Performance"},
{"ci", "ci", "📦", "CI/CD"},
{"config", "cfg", "🔧", "Configuration Change"},
{"network", "net", "🌐", "Network Change"},
{"misc", "misc", "📝", "Miscellaneous"},
{"first-commit", "first", "🏁", "First Commit"},
{"milestone", "mile", "🏆", "Milestone"},
{"release", "release", "🎯", "Release"},
{"style", "style", "🎨", "Style Change"},
{"revert", "revert", "⏪", "Revert"},
{"merge", "merge", "🔀", "Merge"},
{"security", "sec", "🔒", "Security Fix"},
{"build", "build", "🏗️", "Build System"},
{"deprecate", "depr", "🗑️", "Deprecation"},
{"ux", "ux", "💡", "UX Improvement"},
{"ui", "ui", "🖼️", "UI Update"},
{"hotfix", "hotfix", "🚑", "Hotfix"},
{"lint", "lint", "🧹", "Linting"},
{"env", "env", "🌱", "Environment Setup"},
{"legal", "legal", "📄", "Legal/Compliance"},
{"infra", "infra", "🏭", "Infrastructure Change"},
{"i18n", "intl", "🌍", "Internationalization"},
{"analytics", "analytics", "📊", "Analytics/Tracking"},
{"rollback", "rollback", "↩️", "Rollback"},
{"prototype", "proto", "🧪", "Prototype/Experiment"},
{"log", "log", "📝", "Logging"},
{"monitoring", "mon", "📈", "Monitoring"},
{"bump", "version", "🔖", "Version Bump"},
}
func resolveCommitType(input string) *CommitType {
input = strings.ToLower(input)
for _, ct := range commitTypes {
if ct.Name == input || ct.Short == input {
return &ct
}
}
return nil
}