diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08aef91..836a062 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,39 +1,20 @@ -# We from the Oslo project decided to pin repos based on the -# commit hash instead of the version tag to prevend arbitrary -# code from running in developer's machines. To update to a -# newer version, run `pre-commit autoupdate` and then replace -# the newer versions with their commit hash. - -default_language_version: - python: python3 - repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 9136088a246768144165fcc3ecc3d31bb686920a # v3.3.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - # Replaces or checks mixed line ending - id: mixed-line-ending args: ['--fix', 'lf'] exclude: '.*\.(svg)$' - # Forbid files which have a UTF-8 byte-order marker - - id: check-byte-order-marker - # Checks that non-binary executables have a proper shebang + - id: fix-byte-order-marker - id: check-executables-have-shebangs - # Check for files that contain merge conflict strings. - id: check-merge-conflict - # Check for debugger imports and py37+ breakpoint() - # calls in python source - id: debug-statements - id: check-yaml files: .*\.(yaml|yml)$ - - repo: local + - repo: https://opendev.org/openstack/hacking + rev: 7.0.0 hooks: - - id: flake8 - name: flake8 - additional_dependencies: - - hacking>=3.0.1,<3.1.0 - language: python - entry: flake8 - files: '^.*\.py$' + - id: hacking + additional_dependencies: [] exclude: '^(doc|releasenotes|tools)/.*$' diff --git a/requirements.txt b/requirements.txt index 1532602..7b839ca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,2 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. - docutils>=0.11 # OSI-Approved Open Source, Public Domain pbr>=2.0 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 6a75259..40c336c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,5 @@ -hacking>=3.0,<3.1.0 # Apache-2.0 coverage>=4.0,!=4.4 # Apache-2.0 ddt>=1.0.1 # MIT sphinx>=2.0.0,!=2.1.0 # BSD testtools>=1.4.0 # MIT -pre-commit>=2.6.0 # MIT stestr>=2.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index b2ad6e8..d20de30 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,8 @@ [tox] -minversion = 3.1.1 +minversion = 4.6.0 envlist = py3,pep8 -skipsdist = true -# Automatic envs (pyXX) will only use the python version appropriate to that -# env and ignore basepython inherited from [testenv] if we set -# ignore_basepython_conflict. -ignore_basepython_conflict = true [testenv] -basepython = python3 -usedevelop = true setenv = LANGUAGE=en_US LC_ALL=en_US.utf-8 @@ -26,7 +19,11 @@ commands = stestr slowest [testenv:pep8] -commands = pre-commit run -a +skip_install = true +deps = + pre-commit +commands = + pre-commit run --all-files --show-diff-on-failure [testenv:venv] commands = {posargs}