Skip to content

Commit

Permalink
Merge pull request #416 from loicreynier/feat-poetry
Browse files Browse the repository at this point in the history
Add Poetry hooks
  • Loading branch information
domenkozar authored Mar 31, 2024
2 parents c11e43a + 1d744bb commit 9fc61b5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ use nix
- [isort](https://github.com/PyCQA/isort)
- [mypy](https://github.com/python/mypy)
- [pyright](https://github.com/microsoft/pyright)
- [poetry](https://python-poetry.org/docs/pre-commit-hooks)
- [pyupgrade](https://github.com/asottile/pyupgrade)
- [pylint](https://github.com/PyCQA/pylint)
- [flake8](https://github.com/PyCQA/flake8)
Expand Down
16 changes: 16 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,22 @@ in
"${binPath} analyse";
types = [ "php" ];
};
poetry-check = {
name = "poetry check";
description = "Check the Poetry config for errors";
package = tools.poetry;
entry = "${hooks.poetry-check.package}/bin/poetry check";
files = "^(poetry\\.lock$|pyproject\\.toml)$";
pass_filenames = false;
};
poetry-lock = {
name = "poetry lock";
description = "Update the Poetry lock file";
package = tools.poetry;
entry = "${hooks.poetry-lock.package}/bin/poetry lock";
files = "^(poetry\\.lock$|pyproject\\.toml)$";
pass_filenames = false;
};
pre-commit-hook-ensure-sops = {
name = "pre-commit-hook-ensure-sops";
package = tools.pre-commit-hook-ensure-sops;
Expand Down
2 changes: 2 additions & 0 deletions nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
, opam
, ormolu
, pkgsBuildBuild
, poetry
, pre-commit-hook-ensure-sops ? null
, python3Packages
, php82Packages
Expand Down Expand Up @@ -126,6 +127,7 @@ in
nixpkgs-fmt
ormolu
pre-commit-hook-ensure-sops
poetry
revive
ripsecrets
ruff
Expand Down

0 comments on commit 9fc61b5

Please sign in to comment.