Skip to content

Commit

Permalink
chore: lint commit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmh committed Feb 5, 2024
1 parent 62157d5 commit ef5c315
Show file tree
Hide file tree
Showing 6 changed files with 3,005 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Linting"
on: [push, pull_request]
jobs:
check-commit-message:
name: Ensure messages conform to Conventional Commits standard
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 18.15
uses: actions/setup-node@v3
with:
node-version: '18.15'
- name: Install root dependencies
run: yarn install

- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: yarn lint:commit --from HEAD~1 --to HEAD --verbose

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

stylua:
name: Check codestyle
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --color always --check .
version: v0.15.1
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
node_modules/
.tests/
873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "mdx.nvim",
"private": true,
"packageManager": "[email protected]",
"devDependencies": {
"@commitlint/config-conventional": "^17.6.1",
"commitlint": "latest",
"conventional-changelog-conventionalcommits": "^5.0.0",
"cspell": "^6.31.1",
"husky": "^8.0.3"
},
"scripts": {
"prepare": "husky install",
"lint:commit": "commitlint --config commitlint.config.js"
}
}
Loading

0 comments on commit ef5c315

Please sign in to comment.