Skip to content

Commit

Permalink
👷 misc: use git-sumi to lint commit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Feb 7, 2024
1 parent 28d0f70 commit c193d4d
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/git-sumi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint pull request title

on:
pull_request:
types:
- opened
- edited
- synchronize
- ready_for_review

permissions:
pull-requests: read

jobs:
main:
name: Run git-sumi
runs-on: ubuntu-latest
steps:
- uses: welpo/git-sumi-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions sumi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# git-sumi ~ configuration file
# Config: https://sumi.rs/docs/configuration
# Rules: https://sumi.rs/docs/rules

# Suppress progress messages.
quiet = false

# Shows the parsed commit message post-linting. See 'format' for options.
display = true

# Output format for the parsed commit message. Options: "cli", "json", "table", "toml".
format = "cli"

# Process each non-empty line in the commit message as an individual commit.
split_lines = false

# Rule: include one valid Gitmoji: https://gitmoji.dev/
gitmoji = true

# Rule: commit description must start with the specified case. Options: "any", "lower", "upper".
description_case = "lower"

# Rule: use the imperative mood in the description (e.g. "Fix bug" instead of "Fixed bug").
imperative = true

# Rule: do not end commit header with a period.
no_period = true

# Rule: limit the header to the specified length. A value of 0 disables this rule.
max_header_length = 55

# Rule: wrap the body at the specified length. A value of 0 disables this rule.
max_body_length = 80

# Rule: disallow leading/trailing whitespace and consecutive spaces.
whitespace = true

# Rule: follow Conventional Commits format: https://www.conventionalcommits.org/
conventional = true

# Rule: only allow the specified commit scopes. Example: ["docs", "cli"]. An empty list allows any scope.
scopes_allowed = []

# Rule: only allow the specified commit types. Example: ["feat", "fix"]. An empty list allows any type.
types_allowed = ["feat", "fix", "docs", "refactor", "chore", "misc", "style"]

# Rule: commit header must match the specified (regex) pattern. Example: '^JIRA-\d+:'
header_pattern = '^([\p{Emoji_Presentation}\p{Extended_Pictographic}\u{200D}])' # The first character must be an emoji.

0 comments on commit c193d4d

Please sign in to comment.