Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.vscode
.DS_Store
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
repos:
- repo: local
hooks:
- id: commitlint
name: Commitlint
entry: python -m src.commitlint.cli --file
language: python
stages: [commit-msg]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-added-large-files
- id: check-yaml
- id: pretty-format-json
args: [--autofix]
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/akaihola/darker
rev: 1.7.1
hooks:
- id: darker
args:
- --isort
- --flynt
- --lint=flake8 --max-line-length=88 --ignore=E203,W503
- --lint=mypy --strict
- --lint=pylint --max-line-length=88 --disable=W0511
additional_dependencies:
- black==23.3.0
- flake8==5.0.4
- flynt==0.77
- isort==5.12.0
- mypy==1.8.0
- pylint==2.17.4
6 changes: 6 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- id: commitlint
name: commitlint
description: "commitlint for conventional commit message"
entry: commitlint --file
language: python
stages: [commit-msg]
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# How to Contribute

## Install Development Dependencies (Using Pipenv)

All the dependencies are managed by Pipenv. Please install Pipenv on your system first by following the instructions at [https://pipenv.pypa.io/en/latest/installation/](https://pipenv.pypa.io/en/latest/installation/).

Once Pipenv is installed, you can install the development dependencies by running the following command:

```bash
pipenv install --dev
```

## Install pre-commit hooks

To install pre-commit and commit-msg hook for this project, run the following command:

```bash
pipenv run install-hooks
```
16 changes: 16 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]
pre-commit = "*"
pytest = "*"
pytest-cov = "*"

[scripts]
test = "pytest"
coverage = "pytest --cov=src/ --no-cov-on-fail"
install-hooks = "pre-commit install --hook-type pre-commit --hook-type commit-msg"
263 changes: 263 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# commitlint
commitlint is is a pre-commit hook designed to lint your commit messages according to the Conventional Commits standard.

commitlint is is a pre-commit hook designed to lint your commit messages according to the [Conventional Commits](https://www.conventionalcommits.org/) standard.

## How to use

1. Add the following configuration on `.pre-commit-config.yaml`.

```yaml
repos:
...

- repo: https://github.com/opensource-nepal/commitlint
rev: 0.1.0
hooks:
- id: commitlint

...
```

2. Install the `commit-msg` hook in your project repo:

```bash
pre-commit install --hook-type commit-msg
```

> **_NOTE:_** Installing just using `pre-commit install` will not work.

## Contribution

We appreciate feedback and contribution to this package. To get started please see our [contribution guide](./CONTRIBUTING.md).
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
Loading