From dacb5f42fe7b74dad0b4e76393cc65d6ddbfc312 Mon Sep 17 00:00:00 2001 From: "guillaume.lambert" Date: Wed, 16 Nov 2022 14:03:15 +0100 Subject: [PATCH] Update pre-commit and tox configuration - update pre-commit repo revision - use new gitlint-ci pre-commit profile https://github.com/jorisroovers/gitlint/pull/192 - update pre-commit configuration accordingly especially remove gitlint profile from envlist since it is now supersed by gitlint-ci pre-commit profile Signed-off-by: guillaume.lambert Change-Id: I0984526059a4f869099c32f22909618fd294c549 --- .pre-commit-config.yaml | 10 ++++++---- tox.ini | 8 +------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index baa871ba7..e2513a913 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,27 +1,29 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.3.0 hooks: - id: trailing-whitespace exclude: '^ordmodels/' # ordmodels trailing blanks shall preferably be fixed in OpenROADM upstream repo - repo: https://github.com/jorisroovers/gitlint - rev: v0.16.0 + rev: v0.18.0 hooks: - id: gitlint stages: [commit-msg] + - id: gitlint-ci + stages: [manual] - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.1.10 + rev: v1.3.1 hooks: - id: remove-tabs stages: [commit] exclude: '^(.git/|docs/make.bat|docs/Makefile|ordmodels/)' - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.7 + rev: v2.0.0 hooks: - id: autopep8 args: ['--in-place', '--max-line-length=120'] diff --git a/tox.ini b/tox.ini index 3baf8b258..ae81c1041 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,6 @@ envlist = buildcontroller,testsPCE, docs-linkcheck checkbashisms pre-commit - gitlint pylint skipsdist = true setupdir = tests/ @@ -310,12 +309,7 @@ deps = pre-commit passenv = HOME commands = pre-commit run --all-files --show-diff-on-failure - pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG - # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage. - # Its default arguments --passed and --msg-filename are different from CI recommandations. - # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file. - # A dedicated gitlint profile for CI is proposed below. Also to behave fine locally, this profile must have access - # to the HOME variable so that Gitlint can retrieve Git user settings. + pre-commit run gitlint-ci --hook-stage manual [testenv:gitlint] basepython = python3 -- 2.36.6