Skip to content

Commit

Permalink
test 🧪: applying bearer recomendations
Browse files Browse the repository at this point in the history
Signed-off-by: moualhi zine el abidine <zmoualhi@outlook.com>
  • Loading branch information
muandane committed Apr 9, 2024
1 parent a8aa947 commit 789ded1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ repos:
rev: v1.55.2
hooks:
- id: golangci-lint-full
# - repo: local
# hooks:
# - id: goji-check
# name: goji check
# description: >
# Check whether the current commit message follows commiting rules. Allow empty commit messages by default, because they typically indicate to Git that the commit should be aborted.
# entry: scripts/goji-check.sh
# language: script
- repo: local
hooks:
- id: goji-check
name: goji check
description: >
Check whether the current commit message follows commiting rules. Allow empty commit messages by default, because they typically indicate to Git that the commit should be aborted.
entry: scripts/goji-check.sh
language: script
2 changes: 1 addition & 1 deletion cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var checkCmd = &cobra.Command{
}

// Define the regex pattern for a conventional commit message
re := regexp.MustCompile(`^[\w\s]*?(feat|fix|docs|style|refactor|test|chore|build|ci|perf|improvement|package)(\([\w\s]*\))?[: ].+$`)
re := regexp.MustCompile(`\A[\w\s]*?(feat|fix|docs|style|refactor|test|chore|build|ci|perf|improvement|package)(\([\w\s]*\))?[: ].+\z`)
if !re.MatchString(commitMessage) {
fmt.Printf("Error: Your commit message does not follow the conventional commit format. %s", commitMessage)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func GitRepo() (string, error) {
revParse := exec.Command("git", "rev-parse", "--show-toplevel")
repoDirBytes, err := revParse.Output()
if err != nil {
log.Fatalf("Error finding git root directory: %v", err)
log.Fatalf("Error finding git root directory")
}
repoDir := strings.TrimRight(string(repoDirBytes), "\n")

Expand Down

0 comments on commit 789ded1

Please sign in to comment.