Skip to content

Commit

Permalink
📝 docs(contributing): Add commit style guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
sassko authored and orazefabian committed May 13, 2024
1 parent 999c5d9 commit 0b30afd
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,70 @@
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Version control
### Commit style
To make sure that all our commits remain consistent through time, the project is set up to validate (on Pull Requests)
that all commits have to the following format:

```bash
:gitmoji: type(scope?): subject
body?
footer?
```

For that we use [commitlint-config-gitmoji](https://www.npmjs.com/package/commitlint-config-gitmoji)
as our [commitlint](https://www.npmjs.com/package/commitlint), if you are worried you might write a commit
using a wrong emoji, make sure have the project node dependencies installed (`npm install`), this will enable
a pre-commit hook that checks for the correct format before each commit.

If desired, you could also bypass this check by adding the `-n` option at the end of your commit,
this might be convenient if you just want to try some things out.

```shell
git commit -m "wrong commit" -n
```

#### [:gitmoji:](https://gitmoji.dev/) (required)
Must be a valid emoji code, you could easily find out the correct one by executing
in your shell:

```shell
npx gitmoji-cli --search <string>
```

where `<string>` could be the word "bug" if you are looking for the bug emoji.

#### type (required)
**Must** be one of the following

```text
'feat' // Introducing new features
'fix' // Fixing a bug
'refactor' // Refactoring code (Not Introducing features or fix)
'docs' // add documents
'test' // Adding unit tests or e2e test
'perf' // Improving performance
'revert' // Reverting changes or commits
'style' // Updating the UI and style files
'build' // build artifacts
'ci' // working about CI build system
'wip' // Work in progress
'chore'; // Work with configuration or other stuff
```

#### scope (optional)
e.g. Unguard microservices (`like-service`, `membership-service`, etc), `docs`, etc.

#### subject (required)
**Must** be written following the styles: `Sentence case`, `Start Case` and `PascalCase`.

And use them as you normally would:
* `Sentence case` for normal sentences
* `Start Case` for names
* `PascalCase` for referring to file/class names that have that casing style.

*Note: Acronyms are allowed:* `HTTP`, `SSL`, `DSL`.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Expand Down

0 comments on commit 0b30afd

Please sign in to comment.