forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tooling): add commitlint (strapi#18402)
resolves strapi#16645
- Loading branch information
1 parent
374327c
commit b056d71
Showing
8 changed files
with
3,589 additions
and
2,907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { UserConfig } from '@commitlint/types'; | ||
import { RuleConfigSeverity } from '@commitlint/types'; | ||
|
||
const config: UserConfig = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'type-enum': [ | ||
RuleConfigSeverity.Error, | ||
'always', | ||
[ | ||
'chore', | ||
'ci', | ||
'docs', | ||
'enhancement', | ||
'feat', | ||
'fix', | ||
'release', | ||
'revert', | ||
'security', | ||
'test', | ||
], | ||
], | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: 'Commitlint' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
actions: read | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- uses: nrwl/nx-set-shas@v3 | ||
- name: Monorepo install | ||
uses: ./.github/actions/yarn-nm-install | ||
- name: Validate PR commits with commitlint | ||
if: github.event_name == 'pull_request' | ||
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install -- commitlint --edit ${1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint-staged | ||
npx --no-install lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
defaultSemverRangePrefix: '' | ||
compressionLevel: mixed | ||
|
||
defaultSemverRangePrefix: "" | ||
|
||
enableGlobalCache: true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.