diff --git a/.commitlintrc.json b/.commitlintrc.json deleted file mode 100644 index 0073e93bd..000000000 --- a/.commitlintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["@commitlint/config-conventional"], - "rules": { - "footer-max-line-length": [2, "always", 200] - } -} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 47b2beffb..92ba2f29b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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/) diff --git a/.gitignore b/.gitignore index a395a5608..849ca6e85 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ docs/_build venv/ # Include tracked hidden files and directories in search and diff tools -!.commitlintrc.json !.dockerignore !.env !.github/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b04f04422..9af71bdb4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/requirements-lint.txt b/requirements-lint.txt index 0175aad59..8bdf1239b 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -1,5 +1,6 @@ -argcomplete==2.0.0 +argcomplete<=2.0.0 black==22.3.0 +commitizen==2.24.0 flake8==4.0.1 isort==5.10.1 mypy==0.950 diff --git a/tox.ini b/tox.ini index 4d502be8e..c8ddbaa89 100644 --- a/tox.ini +++ b/tox.ini @@ -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