Skip to content

Commit

Permalink
ci: integrated commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
aj3sh committed Feb 1, 2024
1 parent 4127b12 commit ed06d0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Python Package

on:
push:
branches: ["main"]
branches: ['main']
pull_request:

jobs:
Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3
Expand All @@ -30,13 +30,17 @@ jobs:
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run commitlint
uses: opensource-nepal/[email protected]

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --ignore=E203,W503 --max-line-length=127 --statistics
# For the reason behind ignoring E203 and W503, visit https://blackq.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated
- name: Run tests
run: |
coverage run -m unittest discover nepali/tests -v
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repos:
- id: pretty-format-json
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/akaihola/darker
rev: 1.7.1
hooks:
Expand All @@ -25,3 +26,8 @@ repos:
- isort==5.12.0
- mypy==1.3.0
- pylint==2.17.4

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

0 comments on commit ed06d0d

Please sign in to comment.