Skip to content

chore(ci): replace commitlint with commitizen #1998

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

Merged
merged 1 commit into from
May 1, 2022
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
6 changes: 0 additions & 6 deletions .commitlintrc.json

This file was deleted.

10 changes: 3 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,16 @@ env:
PY_COLORS: 1

jobs:
commitlint:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4

linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- run: pip install --upgrade tox
- name: Run commitizen
run: tox -e cz
- name: Run black code formatter (https://black.readthedocs.io/en/stable/)
run: tox -e black -- --check
- name: Run flake8 (https://flake8.pycqa.org/en/latest/)
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ docs/_build
venv/

# Include tracked hidden files and directories in search and diff tools
!.commitlintrc.json
!.dockerignore
!.env
!.github/
Expand Down
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ repos:
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v8.0.0
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.24.0
hooks:
- id: commitlint
additional_dependencies: ['@commitlint/config-conventional']
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
Expand Down
3 changes: 2 additions & 1 deletion requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
argcomplete==2.0.0
argcomplete<=2.0.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open a PR in commitizen to bump to v2 so we can pin this again later.

black==22.3.0
commitizen==2.24.0
flake8==4.0.1
isort==5.10.1
mypy==0.950
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ deps = -r{toxinidir}/requirements-lint.txt
commands =
pylint {posargs} gitlab/

[testenv:cz]
basepython = python3
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
commands =
cz check --rev-range 65ecadc..HEAD # cz is fast, check from first valid commit

[testenv:twine-check]
basepython = python3
deps = -r{toxinidir}/requirements.txt
Expand Down