Skip to content

Commit

Permalink
wrong: introuce commit messge linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Apr 8, 2024
1 parent 7a1fe14 commit 1f4931e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
extends:
- '@commitlint/config-conventional'
- '@commitlint/config-lerna-scopes'
rules:
header-max-length: [1, 'always', 72]
body-leading-blank: [2, 'always']
subject-empty: [2, 'never']
subject-full-stop: [2, 'never', '.']
subject-case:
- 2
- never
- - sentence-case
- start-case
- pascal-case
type-empty: [2, 'never']
type-enum:
- 2
- always
- - fix
- feat
- refactor
- revert
- test
- perf
- style
- chore
- docs
help: |
**Possible types**:
`fix`: Solves a bug.
`feat`: Adds a new feature.
`refactor`: Rewrites code without feature, performance or bug changes.
`revert`: Changes that reverting other changes.
`test`: Adds missing or correcting existing tests.
`perf`: A code change that improves performance.
`style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
`chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation.
`docs`: Documentation only changes.
39 changes: 39 additions & 0 deletions .github/workflows/mev-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,45 @@ on:
- main

jobs:
commitlint:
name: Check Commit Message
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install required dependencies
run: |
sudo apt update
sudo apt install -y git curl
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install --save-dev @commitlint/config-conventional
npm install --save-dev @commitlint/config-lerna-scopes
npm install commitlint@latest
- name: Validate current commit (last commit) message
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commit messages
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

go-modules:
name: Test and Build Go Modules
runs-on: ubuntu-latest
Expand Down

0 comments on commit 1f4931e

Please sign in to comment.