Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Commit Lint

on:
pull_request:
types: [opened, synchronize, edited]

jobs:
lint-commits:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install dependencies
run: npm ci

- name: Lint commit messages
uses: wagoid/commitlint-github-action@v4
with:
configFile: ./commitlint.config.cjs
failOnWarnings: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ logs/
.settings
.springBeans
.sts4-cache
node_modules/

### IntelliJ IDEA ###
.idea
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "$1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure Husky hook script includes the proper header
The hook currently only runs the lint command but is missing the shebang and Husky loader. Without these, it may not execute correctly. Please apply:

+#!/usr/bin/env sh
+. "$(dirname "$0")/_/husky.sh"
 npx --no -- commitlint --edit "$1"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
npx --no -- commitlint --edit "$1"
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"
npx --no -- commitlint --edit "$1"

5 changes: 5 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const config = require('@commitlint/config-conventional');

module.exports = {
...config,
};
Loading