Skip to content

Commit

Permalink
Adopt commitlint standards (#33)
Browse files Browse the repository at this point in the history
* chore: add commitlint

* chore: add husky git hooks

* test: add test folder to linter

* docs: mention commitlint on contributing page

* docs: update contributing.md

Co-Authored-By: James George <jamesgeorge998001@gmail.com>

* docs: upadate readme.md
  • Loading branch information
tisoap authored and jamesgeorge007 committed Oct 9, 2019
1 parent 95006a7 commit 5b0df17
Show file tree
Hide file tree
Showing 6 changed files with 582 additions and 24 deletions.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Users are required to solve 30 tasks that take them through the basic constructs

## Available Commands

| command | description |
| command | description |
| -------------- | ---------------- |
| teachcode init | Initializes all the tasks |
| teachcode fetchtask <key> | Fetches the task correponding to key provided |
Expand All @@ -56,6 +56,41 @@ Users are required to solve 30 tasks that take them through the basic constructs

Contributions of any kind are welcomed. Make sure that you go through these [guidelines](https://teachcode.madlabs.xyz/guide/contributing.html).

### How should I write a commit message?

This project uses [Commitlint](https://github.com/conventional-changelog/commitlint/#what-is-commitlint) to check if the commit messages meet the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/).

The full pattern is:
```sh
type(scope?): subject #scope is optional

body? #body is optional

footer? #footer is optional
```

Following that pattern, your commit messages should look like these:
```sh
feat: activate open collective
```

```sh
chore: correct typo

It should be "guest" and not "gest"
```

```sh
refactor(cli): drop support for node 6

BREAKING CHANGE: you will need to update your node version to keep using this CLI
This closes #123
```

### How should I name my branches?

Prefix your branch names with `feat/`, `docs/` or `hotfix/` for feature proposals, documentation and bug fixes, respectively.

## License

Licensed under `GNU General Public License V3.0`.
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
7 changes: 4 additions & 3 deletions docs/guide/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ title: 'Contributing'
4. Type in `npm link` which creates a symlink and thereby allowing `teachcode` to be accessed globally.
5. Make your life changing changes.
6. Ensure that your code is free from linting errors and is as per prettier conventions by typing in `npm run lint`.
7. Now you may push it to the remote repository by switching over to another branch and finally proposing a Pull Request to the base fork.
7. We use [commitlint conventional naming rules](https://www.npmjs.com/package/@commitlint/config-conventional#rules) for our commits, make sure that you follow them.
8. Now you may push it to the remote repository by switching over to another branch and finally proposing a Pull Request to the base fork.


## Points to ponder

1. Make sure that you submit an issue first if you have something in mind that you're willing to work on.
2. Follow a `rebase` strategy inorder to update your remote branch with the latest changes.
3. Prefix your branch names with `feat/` or `bugfix/` as per the case.
2. Follow a `rebase` strategy in order to update your remote branch with the latest changes.
3. Prefix your branch names with `feat/`, `docs/` or `hotfix/` for feature proposals, docs-related and bug fixes, respectively.
Loading

0 comments on commit 5b0df17

Please sign in to comment.