Skip to content

Commit

Permalink
meta: lint PR title (sequelize#14670)
Browse files Browse the repository at this point in the history
* build: line PR title

* meta: replace build,chore,test with meta

* remove commitlint

* docs: update contributing

* meta: update workflow event

Co-authored-by: Rik Smale <[email protected]>
  • Loading branch information
ephys and WikiRik authored Jul 2, 2022
1 parent e480d6e commit 5173697
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 307 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Lint PR"
on:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
main:
name: PR has semantic title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
docs
meta
scopes: |
db2
ibmi
mariadb
mssql
mysql
postgres
snowflake
sqlite
types
ignoreLabels: |
ignore-semantic-pull-request
20 changes: 0 additions & 20 deletions .husky/commit-msg

This file was deleted.

26 changes: 21 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,33 @@ If you open the `package.json` file with Visual Studio Code, you will find a sma

### 6. Commit your modifications

Sequelize follows the [AngularJS Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#heading=h.em2hiij8p46d). The allowed categories are `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test` and `meta`.
We squash all commits into a single one when we merge your PR.
That means you don't have to follow any convention in your commit messages,
but you will need to follow the [Conventional Commits Conventions](https://www.conventionalcommits.org/en/v1.0.0/) when writing the title of your PR.

We will then use the title of your PR as the message of the Squash Commit. It will then be used to automatically generate a changelog and calculate the next [semver](https://semver.org/) version number.

We use a simple conventional commits convention:
- The allowed commit types are: `docs`, `feat`, `fix`, `meta`.
- We allow the following commit scopes (they're the list of dialects we support, plus `types` for TypeScript-only changes):
- `postgres`
- `mysql`
- `mariadb`
- `sqlite`
- `mssql`
- `db2`
- `ibmi`
- `snowflake`
- `types`
- If your changes impact more than one scope, simply omit the scope.

Example:

```
feat(pencil): add `graphiteWidth` option
feat(postgres): support specifying a custom name for enums
```

Commit messages are used to automatically generate a changelog and calculate the next version number according to [semver](https://semver.org/). They will be validated automatically using [commitlint](https://github.com/marionebl/commitlint).

Then push and send your pull request. Happy hacking and thank you for contributing.
Happy hacking and thank you for contributing.

# Coding guidelines

Expand Down
26 changes: 0 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
"wkx": "^0.5.0"
},
"devDependencies": {
"@commitlint/cli": "17.0.2",
"@commitlint/config-angular": "17.0.0",
"@ephys/eslint-config-typescript": "17.0.0",
"@rushstack/eslint-patch": "1.1.4",
"@types/chai": "4.3.1",
Expand Down Expand Up @@ -162,30 +160,6 @@
"database",
"db"
],
"commitlint": {
"extends": [
"@commitlint/config-angular"
],
"rules": {
"type-enum": [
2,
"always",
[
"build",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"meta"
]
]
}
},
"lint-staged": {
"*.{js,mjs,cjs,ts,mts,cts}": "eslint --fix --report-unused-disable-directives"
},
Expand Down
Loading

0 comments on commit 5173697

Please sign in to comment.