From c193d4d4e898def908ff923958ccab7af4023664 Mon Sep 17 00:00:00 2001 From: welpo Date: Wed, 7 Feb 2024 01:10:31 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20misc:=20use=20git-sumi=20to=20li?= =?UTF-8?q?nt=20commit=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/git-sumi.yml | 21 +++++++++++++++ sumi.toml | 48 ++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/git-sumi.yml create mode 100644 sumi.toml diff --git a/.github/workflows/git-sumi.yml b/.github/workflows/git-sumi.yml new file mode 100644 index 000000000..b1af84c94 --- /dev/null +++ b/.github/workflows/git-sumi.yml @@ -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 }} diff --git a/sumi.toml b/sumi.toml new file mode 100644 index 000000000..3563aa2cc --- /dev/null +++ b/sumi.toml @@ -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.