Browse Source

precommit: add `pyproject`'s hooks (#1412)

* precommit: add `pyproject`'s hooks

* apply precommit

* Update dev_config/python/.pre-commit-config.yaml

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
Jirka Borovec 1 year ago
parent
commit
46bd83678a
2 changed files with 13 additions and 1 deletions
  1. 10 0
      dev_config/python/.pre-commit-config.yaml
  2. 3 1
      pyproject.toml

+ 10 - 0
dev_config/python/.pre-commit-config.yaml

@@ -7,6 +7,16 @@ repos:
       - id: check-yaml
       - id: debug-statements
 
+  - repo: https://github.com/tox-dev/pyproject-fmt
+    rev: 1.7.0
+    hooks:
+      - id: pyproject-fmt
+  - repo: https://github.com/abravalheri/validate-pyproject
+    rev: v0.16
+    hooks:
+      - id: validate-pyproject
+
+
   - repo: https://github.com/astral-sh/ruff-pre-commit
     # Ruff version.
     rev: v0.3.7

+ 3 - 1
pyproject.toml

@@ -49,8 +49,10 @@ pytest-asyncio = "*"
 torch = "2.2.2"
 
 [build-system]
-requires = ["poetry-core"]
 build-backend = "poetry.core.masonry.api"
+requires = [
+  "poetry-core",
+]
 
 [tool.autopep8]
 # autopep8 fights with mypy on line length issue