Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9bcea31

Browse files
committedMar 6, 2022
refactor(lint): rename Lint, LintCommit to ParseAndLint, Lint
1 parent 6b6bb3d commit 9bcea31

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎internal/cmd/lint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func runLint(confFilePath, fileInput string) (lintResult string, hasError bool,
4646
return "", false, err
4747
}
4848

49-
result, err := linter.Lint(commitMsg)
49+
result, err := linter.ParseAndLint(commitMsg)
5050
if err != nil {
5151
return "", false, err
5252
}

‎lint/linter.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ func New(conf *Config, rules []Rule) (*Linter, error) {
1919
return l, nil
2020
}
2121

22-
// Lint checks the given commitMsg string against rules
23-
func (l *Linter) Lint(commitMsg string) (*Result, error) {
22+
// ParseAndLint checks the given commitMsg string against rules
23+
func (l *Linter) ParseAndLint(commitMsg string) (*Result, error) {
2424
msg, err := l.parser.Parse(commitMsg)
2525
if err != nil {
2626
issues := l.parserErrorRule(commitMsg, err)
2727
return newResult(commitMsg, issues...), nil
2828
}
29-
return l.LintCommit(msg)
29+
return l.Lint(msg)
3030
}
3131

32-
// LintCommit checks the given Commit against rules
33-
func (l *Linter) LintCommit(msg Commit) (*Result, error) {
32+
// Lint checks the given Commit against rules
33+
func (l *Linter) Lint(msg Commit) (*Result, error) {
3434
issues := make([]*Issue, 0, len(l.rules))
3535

3636
for _, rule := range l.rules {

0 commit comments

Comments
 (0)
Please sign in to comment.