Skip to content

Commit 005201b

Browse files
committed
doc: add docs to each function exported
1 parent ad455eb commit 005201b

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

commiter/commiter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
"os/exec"
88
)
99

10-
// ParseCommitMessage fekopkp
10+
// ParseCommitMessage add the message Type following the real user message
1111
func parseCommitMessage(commitType string, input string) string {
1212
return fmt.Sprintf("%s: %s", commitType, input)
1313
}
1414

15-
// CommitMessage should
15+
// CommitMessage launch command to commit the message
1616
func CommitMessage(commitType string, input string) bool {
1717
formattedMessage := parseCommitMessage(commitType, input)
1818
myArguments := []string{"commit", "-m", formattedMessage}

interact/prompt.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import (
1010
"github.com/manifoldco/promptui"
1111
)
1212

13-
// AskForCommit wesh
13+
// AskForCommit ask if the user wants to commit
14+
// and return true if so
1415
func AskForCommit() bool {
1516
prompt := promptui.Select{
1617
Label: "Do you want to commit ? [Yes/No]",
@@ -31,7 +32,7 @@ func getDescriptions(config jsonMapping.CommitConfig) []string {
3132
return res
3233
}
3334

34-
// AskForCommit wesh
35+
// AskCommitType ask which kind of commit the user wants
3536
func AskCommitType(config jsonMapping.CommitConfig) string {
3637
descriptions := getDescriptions(config)
3738
prompt := promptui.Select{
@@ -46,7 +47,8 @@ func AskCommitType(config jsonMapping.CommitConfig) string {
4647
return config.Rules[index].Prefix
4748
}
4849

49-
// AskForCommit wesh
50+
// AskForCommit ask if the user wants to create a sample file
51+
// and return true if so
5052
func AskForCreate() bool {
5153
prompt := promptui.Select{
5254
Label: "No .commit.json found. Do you want to create a simple one ? [Yes/No]",
@@ -59,7 +61,7 @@ func AskForCreate() bool {
5961
return result == "Yes"
6062
}
6163

62-
// AskMessage is blabla
64+
// AskMessage ask the user which message he wants to commits and return it
6365
func AskMessage() string {
6466

6567
validate := func(input string) error {

jsonMapping/mapper.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,20 @@ func DecodeJsonConfig(input string) CommitConfig {
5252
return config
5353
}
5454

55+
// CreateSample simple sample file for .commit.json
5556
func CreateSample() bool {
5657
config := CommitConfig{
5758
Name: "My Config",
5859
Description: "Hey this is my config for commit",
5960
Rules: []PrefixRule{
60-
PrefixRule{
61+
{
6162
Prefix: "feat",
6263
Description: "feat: Implement new feature"},
63-
PrefixRule{
64+
{
6465
Prefix: "doc",
6566
Description: "doc: writing doc",
6667
},
67-
PrefixRule{
68+
{
6869
Prefix: "fix",
6970
Description: "fix: fix bug",
7071
},

0 commit comments

Comments
 (0)