Skip to content

Commit

Permalink
chore: add commitlint
Browse files Browse the repository at this point in the history
Adds commitlint. Also updates flake and isort hooks.

Refs RATY-106
  • Loading branch information
nicobav committed Apr 16, 2024
1 parent 680d2a8 commit e459fb8
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"header-max-length": [
2,
"always",
72
],
"body-max-line-length": [
2,
"always",
72
],
"body-leading-blank": [
2,
"always"
],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"deps",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test"
]
]
}
}
12 changes: 11 additions & 1 deletion .github/workflows/py-coding-style.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python coding style
name: Coding style

on:
push:
Expand Down Expand Up @@ -52,3 +52,13 @@ jobs:
with:
linters: isort
run: isort -c .

commitlint:
name: Commit lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check commitlint
uses: wagoid/commitlint-github-action@0d749a1a91d4770e983a7b8f83d4a3f0e7e0874e
24 changes: 19 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
# Keep tool versions in sync with the versions in requirements-dev.txt
minimum_pre_commit_version: 2.13.0
default_install_hook_types: [pre-commit, commit-msg]
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 21.11b1
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [pep8-naming, flake8-bugbear]
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.13.0
hooks:
- id: commitlint
stages: [commit-msg, manual]
additional_dependencies: ["@commitlint/config-conventional"]

0 comments on commit e459fb8

Please sign in to comment.