Skip to content

Commit

Permalink
Merge pull request #104 from VWRoli/ISSUE_#103_add_commit_rule
Browse files Browse the repository at this point in the history
chore: issue #103 Add commit rule for project
  • Loading branch information
dadiorchen authored Sep 14, 2021
2 parents 9ceb138 + a93baa3 commit 296fa80
Show file tree
Hide file tree
Showing 6 changed files with 3,315 additions and 747 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,34 @@ To add a command to a pre-commit hook or create a new one, use:
npx husky add .husky/pre-commit "<your command>"
```

.husky folder contains all our hooks. In this case a pre-commit hook.
.husky folder contains all our hooks. E.g.:

```
npx pretty-quick --staged
```

The [pretty-quick](https://www.npmjs.com/package/pretty-quick) npm package runs Prettier on your changed files.

### Commit Message and PR Title Format

We use [commitlint](https://github.com/conventional-changelog/commitlint), to format out commit messages. Commitlint checks if your commit messages meet the conventional commit format.

You need to use a proper commit message format or you will not be able to commit your changes! husky checks your commit messages before every commit.

Your commit messages will need to follow the [Conventional Commits](https://www.conventionalcommits.org/) format, for example:

```
feat: add new button
```

```
chore: run tests on travis ci
```

```
fix(server): send cors headers
```

### Other resource from Greenstand

We have more tech guides and handbook here:
Expand Down
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'] };
Loading

0 comments on commit 296fa80

Please sign in to comment.