From 509f50596bd654cbf4c124589d3a608879978341 Mon Sep 17 00:00:00 2001 From: Jahn16 Date: Sun, 4 Aug 2024 23:53:40 -0300 Subject: [PATCH 1/2] feat: add ruff-format --- modules/hooks.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/hooks.nix b/modules/hooks.nix index bb194ee6..d4b715d3 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -3185,6 +3185,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol entry = "${hooks.ruff.package}/bin/ruff check --fix"; types = [ "python" ]; }; + ruff-format = + { + name = "ruff"; + description = "An extremely fast Python code formatter, written in Rust."; + package = tools.ruff; + entry = "${hooks.ruff.package}/bin/ruff format"; + types = [ "python" ]; + }; rustfmt = let inherit (hooks.rustfmt) packageOverrides; From 2d366523b68afee27c0ddb40cd0f46c7c51ef563 Mon Sep 17 00:00:00 2001 From: Jahn16 Date: Sun, 4 Aug 2024 23:53:49 -0300 Subject: [PATCH 2/2] docs: add ruff-format to python list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ac188501..4bdc2409 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,7 @@ clang-format supports. - [poetry](https://python-poetry.org/docs/pre-commit-hooks) - [pyupgrade](https://github.com/asottile/pyupgrade) - [ruff](https://github.com/charliermarsh/ruff) +- [ruff-format](https://github.com/charliermarsh/ruff) - [sort-requirements-txt](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/requirements_txt_fixer.py) ### PHP