From 3eda27f1ca6811bb1e3683ca9c206575c0a0cdda Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 8 Jul 2024 01:26:02 +0000 Subject: [PATCH 1/3] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9?narHash=sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh%2BBls%3D' (2024-06-30) → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7?narHash=sha256-pQMhCCHyQGRzdfAkdJ4cIWiw%2BJNuWsTX7f0ZYSyz0VY%3D' (2024-07-03) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/1e3deb3d8a86a870d925760db1a5adecc64d329d?narHash=sha256-vN5xJAZ4UGREEglh3lfbbkIj%2BMPEYMuqewMn4atZFaQ%3D' (2024-06-27) → 'github:NixOS/nixpkgs/b60793b86201040d9dee019a05089a9150d08b5b?narHash=sha256-PlL/yXNX/C87S2N8lF/HfOJhHForf/l7E6lVWZ4jMrw%3D' (2024-07-07) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd?narHash=sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg%3D' (2024-06-30) → 'github:numtide/treefmt-nix/e1d7bd5ec6fc389eb3a90e232c4150338bf6a508?narHash=sha256-ludjqxhR/5lXwJ1H6zHmZqp%2B4e8dFPHE9FIZ2eBh2G4%3D' (2024-07-07) --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 15505c7..781a82a 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1719745305, - "narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719468428, - "narHash": "sha256-vN5xJAZ4UGREEglh3lfbbkIj+MPEYMuqewMn4atZFaQ=", + "lastModified": 1720368505, + "narHash": "sha256-5r0pInVo5d6Enti0YwUSQK4TebITypB42bWy5su3MrQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1e3deb3d8a86a870d925760db1a5adecc64d329d", + "rev": "ab82a9612aa45284d4adf69ee81871a389669a9e", "type": "github" }, "original": { @@ -50,11 +50,11 @@ ] }, "locked": { - "lastModified": 1719749022, - "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=", + "lastModified": 1720374026, + "narHash": "sha256-ludjqxhR/5lXwJ1H6zHmZqp+4e8dFPHE9FIZ2eBh2G4=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd", + "rev": "e1d7bd5ec6fc389eb3a90e232c4150338bf6a508", "type": "github" }, "original": { From bd2255044cfc7f401fa52c51a1984412e6793c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 8 Jul 2024 12:53:36 +0200 Subject: [PATCH 2/3] remove deprecated formatters --- treefmt.nix | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/treefmt.nix b/treefmt.nix index d9152a4..de1aa6d 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -1,9 +1,9 @@ -{ lib, inputs, ... }: { +{ inputs, ... }: { imports = [ inputs.treefmt-nix.flakeModule ]; - perSystem = { pkgs, ... }: { + perSystem = _: { treefmt = { # Used to find the project root projectRootFile = "flake.lock"; @@ -12,34 +12,18 @@ deadnix.enable = true; deno.enable = true; mypy.enable = true; + ruff.check = true; + ruff.format = true; nixpkgs-fmt.enable = true; shellcheck.enable = true; shfmt.enable = true; statix.enable = true; }; - settings.formatter = - let - sh-includes = [ "*.sh" "direnvrc" ]; - in - { - python = { - command = "sh"; - options = [ - "-eucx" - '' - ${lib.getExe pkgs.ruff} --fix "$@" - ${lib.getExe pkgs.ruff} format "$@" - '' - "--" # this argument is ignored by bash - ]; - includes = [ "*.py" ]; - }; - - shellcheck.includes = sh-includes; - - shfmt.includes = sh-includes; - }; + settings.formatter = { + shellcheck.includes = [ "*.sh" "direnvrc" ]; + shfmt.includes = [ "*.sh" "direnvrc" ]; + }; }; }; } From c57fe2b791247478edde3d99b756699935f13a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 8 Jul 2024 12:55:14 +0200 Subject: [PATCH 3/3] modernize treefmt configuration --- treefmt.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/treefmt.nix b/treefmt.nix index de1aa6d..66167a0 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -3,10 +3,10 @@ inputs.treefmt-nix.flakeModule ]; - perSystem = _: { + perSystem = { treefmt = { # Used to find the project root - projectRootFile = "flake.lock"; + projectRootFile = ".git/config"; programs = { deadnix.enable = true; @@ -20,10 +20,14 @@ statix.enable = true; }; - settings.formatter = { - shellcheck.includes = [ "*.sh" "direnvrc" ]; - shfmt.includes = [ "*.sh" "direnvrc" ]; - }; + settings.formatter = + let + shellIncludes = [ "*.sh" "direnvrc" ]; + in + { + shellcheck.includes = shellIncludes; + shfmt.includes = shellIncludes; + }; }; }; }