From 021ca2a7fa003acb7425668d4bf1a1e210bd3507 Mon Sep 17 00:00:00 2001 From: expelledboy <102334+expelledboy@users.noreply.github.com> Date: Sat, 23 Mar 2024 12:26:52 +0200 Subject: [PATCH] Add ruff linter to pre-commit --- .github/hooks/pre-commit | 3 +++ flake.nix | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100755 .github/hooks/pre-commit diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit new file mode 100755 index 0000000..b466419 --- /dev/null +++ b/.github/hooks/pre-commit @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ruff check ./ diff --git a/flake.nix b/flake.nix index 0639b38..86c5910 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ setuptools wheel venvShellHook - pylint + pkgs.ruff ]); # python setup @@ -35,11 +35,11 @@ unset SOURCE_DATE_EPOCH ''; postShellHook = '' - # python setup unset SOURCE_DATE_EPOCH unset LD_PRELOAD PYTHONPATH=$PWD/$venvDir/${python.sitePackages}:$PYTHONPATH pip install --require-virtualenv -r requirements.txt | grep -v 'already satisfied' + git config --local core.hooksPath .github/hooks ''; };