-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
2,365 additions
and
2,377 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,29 @@ | ||
name: Commit Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "18" | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Run commitlint | ||
run: npx commitlint --from=HEAD~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 |
---|---|---|
@@ -0,0 +1 @@ | ||
npx --no-install commitlint --edit "$1" |
Empty file.
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,41 @@ | ||
const pc = require("picocolors"); | ||
|
||
const scoreRule = (parsed) => { | ||
const validScores = ["js-plugins", "rust-plugins", "all", "none"]; | ||
const isValid = validScores.includes(parsed.scope); | ||
|
||
return [ | ||
isValid, | ||
`current scope is ${pc.yellow(parsed.scope)}, ${pc.green( | ||
"because we need the right scope to do CI dispatch" | ||
)} .Mark ${pc.yellowBright( | ||
"js-plugins" | ||
)} if you need to change the ${pc.yellowBright("js package")}. | ||
Mark ${pc.yellowBright( | ||
"rust-plugins" | ||
)} if you need to change the ${pc.yellowBright( | ||
"rust package" | ||
)} mark ${pc.yellowBright("all")} if you have ${pc.yellowBright( | ||
"both" | ||
)} and ${pc.yellowBright("none if you don't need to send packages")}`, | ||
]; | ||
}; | ||
|
||
module.exports = { | ||
rules: { | ||
// "scope-enum": [2, "always", ["js-plugins", "rust-plugins", "all", "none"]], | ||
"score-rule": [2, "always"], | ||
"type-enum": [ | ||
2, | ||
"always", | ||
["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore"], | ||
], | ||
}, | ||
plugins: [ | ||
{ | ||
rules: { | ||
"score-rule": scoreRule, | ||
}, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
|
@@ -4,13 +4,17 @@ | |
"description": "The collections of farm plugins", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"release": "npx changeset && npx changeset version" | ||
"release": "npx changeset && npx changeset version", | ||
"prepare": "husky" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.7", | ||
"@farmfe/plugin-tools": "latest" | ||
"@farmfe/plugin-tools": "latest", | ||
"commitlint": "^19.5.0", | ||
"husky": "^9.1.6", | ||
"picocolors": "^1.1.0" | ||
} | ||
} |
Oops, something went wrong.