-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(contributions): add conventional commits to lint pr titles (#351)
* commitlint init * chore(husky): initialize husky pre-commit and enforce commit-msg * chore(contributions): add commit lint information on contributions.md * chore(contributing): update md * chore(workflow): add commitlint github workflow * chore(workflow): commit lint pr title * do not lint commit msg, just pr * remove commitlint config from eslintignore * re-add dev deps
- Loading branch information
Showing
7 changed files
with
480 additions
and
7 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
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,31 @@ | ||
name: Lint PR Title | ||
on: | ||
pull_request: | ||
types: ['opened', 'edited', 'reopened', 'synchronize'] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up pnpm | ||
uses: dydxprotocol/setup-pnpm@v1 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: | | ||
pnpm install @commitlint/config-conventional | ||
echo "module.exports = {extends: ['@commitlint/config-conventional'], rules: { 'subject-case': [0,'always',['sentence-case']],'header-max-length': [2, 'always', 120], 'body-max-line-length': [0, 'always', 120] }};" > commitlint.config.js | ||
- name: Lint PR Title | ||
run: | | ||
echo "${PR_TITLE}" | pnpx commitlint --config commitlint.config.ts | ||
env: | ||
PR_TITLE: '${{ github.event.pull_request.title }}' |
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 @@ | ||
pnpm test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default { extends: ['@commitlint/config-conventional'] }; |
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 |
---|---|---|
|
@@ -27,9 +27,11 @@ | |
"ladle-p": "ladle preview", | ||
"lint": "eslint --ext .ts,.tsx src/", | ||
"fix-lint": "eslint --fix --ext .ts,.tsx src/", | ||
"test": "vitest", | ||
"test": "vitest run", | ||
"tsc": "tsc", | ||
"postinstall": "tar -xzC public -f tradingview/tradingview.tgz" | ||
"postinstall": "tar -xzC public -f tradingview/tradingview.tgz", | ||
"prepare": "husky", | ||
"commitlint": "commitlint --edit" | ||
}, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
|
@@ -118,6 +120,8 @@ | |
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.22.5", | ||
"@commitlint/cli": "^19.0.3", | ||
"@commitlint/config-conventional": "^19.0.3", | ||
"@dydxprotocol/v4-proto": "^3.0.0", | ||
"@ladle/react": "^4.0.2", | ||
"@trivago/prettier-plugin-sort-imports": "^4.3.0", | ||
|
@@ -149,6 +153,7 @@ | |
"eslint-plugin-promise": "^6.1.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"husky": "^9.0.11", | ||
"minimist": "^1.2.8", | ||
"node-fetch": "^3.3.1", | ||
"pnpm": "^8.6.6", | ||
|
Oops, something went wrong.