From 93256267699e2fd015745bfdd21c8118cb20087d Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 3 May 2023 11:55:34 +0100 Subject: [PATCH] Use pre-commit for 'pep8' tox target, bump versions We want to bump the versions of hacking, but doing so requires changes in two places: '.pre-commit-config.yaml' and 'tox.ini'. This is silly: we can simply use tox to handle pre-commit and leave all other dependencies to pre-commit. Do this, migrating doc8 to pre-commit and bumping the other dependencies in the process. Change-Id: I26fa07145129d3ef9cb17693427ed70e55dbaaf5 Signed-off-by: Stephen Finucane --- .pre-commit-config.yaml | 11 ++++++++--- tox.ini | 9 ++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5814ebb93..09c805ab4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: mixed-line-ending @@ -16,13 +16,18 @@ repos: - id: debug-statements - id: check-yaml files: .*\.(yaml|yml)$ - exclude: '^.zuul.yaml' + exclude: '^zuul.d/.*$' + - repo: https://github.com/PyCQA/doc8 + rev: v1.1.1 + hooks: + - id: doc8 - repo: local hooks: - id: flake8 name: flake8 additional_dependencies: - - hacking>=3.0.1,<3.1.0 + - hacking>=6.0.1,<6.1.0 + - flake8-import-order>=0.18.2,<0.19.0 language: python entry: flake8 files: '^.*\.py$' diff --git a/tox.ini b/tox.ini index 6602a2901..24ec06df8 100644 --- a/tox.ini +++ b/tox.ini @@ -58,14 +58,9 @@ commands = [testenv:pep8] deps = - hacking>=3.1.0,<4.0.0 # Apache-2.0 - flake8-import-order>=0.17.1 # LGPLv3 - pycodestyle>=2.0.0,<2.7.0 # MIT - Pygments>=2.2.0 # BSD - doc8>=0.8.0 # Apache 2.0 + pre-commit commands = - flake8 {posargs} - doc8 doc/source README.rst + pre-commit run --all-files --show-diff-on-failure [testenv:venv] deps =