update precommit
diff --git a/.flake8 b/.flake8
new file mode 100644
index 0000000..6deafc2
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,2 @@
+[flake8]
+max-line-length = 120
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1dbe818..4975271 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,11 +1,30 @@
repos:
+ - repo: https://github.com/compilerla/conventional-pre-commit
+ rev: v2.0.0
+ hooks:
+ - id: conventional-pre-commit
+ stages:
+ - commit-msg
+
+ - repo: https://github.com/psf/black
+ rev: 24.8.0
+ hooks:
+ - id: black
+
+ - repo: https://github.com/pycqa/flake8
+ rev: 5.0.4
+ hooks:
+ - id: flake8
+
+ - repo: https://github.com/pycqa/isort
+ rev: 5.13.2
+ hooks:
+ - id: isort
+
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
+ - id: check-yaml
+ args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: trailing-whitespace
- - repo: https://github.com/pycqa/flake8
- rev: 7.0.0
- hooks:
- - id: flake8
- args: [--max-line-length=79]
diff --git a/requirements.txt b/requirements.txt
index 2372ce2..140798f 100755
--- a/requirements.txt
+++ b/requirements.txt
@@ -20,4 +20,3 @@
tooz # Apache-2.0
sherlock>=0.4.1 # MIT
kubernetes # Apache-2.0
-pre-commit
diff --git a/test-requirements.txt b/test-requirements.txt
index f09cf7f..2c28785 100755
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -9,3 +9,4 @@
oslotest>=1.10.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testtools>=1.4.0 # MIT
+pre-commit
diff --git a/tox.ini b/tox.ini
index 7bf9cf3..2de6fda 100755
--- a/tox.ini
+++ b/tox.ini
@@ -12,7 +12,6 @@
TERM=linux
deps =
- flake8
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
@@ -50,11 +49,3 @@
[testenv:venv]
commands = {posargs}
-
-[flake8]
-# E123, E125 skipped as they are invalid PEP-8.
-
-show-source = True
-ignore = E123,E125
-builtins = _
-exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build