Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: integrated commitlint #75

Merged
merged 1 commit into from
Feb 14, 2024
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
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/commitlint@v0.2.1

- 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
Loading