juspay / services-flake

NixOS-like services for Nix flakes
https://community.flake.parts/services-flake
MIT License
352 stars 30 forks source link

Formatting checks in CI is limited to `./dev` #45

Closed shivaraj-bh closed 7 months ago

shivaraj-bh commented 1 year ago

...treefmt-check.drv logs from nixci:

treefmt-check> traversed 2 files
treefmt-check> matched 1 files to formatters
treefmt-check> left with 1 files after cache
treefmt-check> of whom 0 files were re-formatted
treefmt-check> all of this in 500ms

treefmt is only traversing the two files present in the dev sub dir.

srid commented 1 year ago

Changing this to justfile should resolve this I believe.

https://github.com/juspay/services-flake/blob/6e7c2087615fc369cb4d29aa520093926cd1070b/dev/flake.nix#L17

shivaraj-bh commented 1 year ago

That doesn't seem to work, it fails with:

treefmt-check> Initialized empty Git repository in /private/tmp/nix-build-treefmt-check.drv-0/project/.git/
treefmt-check> /private/tmp/nix-build-treefmt-check.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 21: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file or directory
treefmt-check> /nix/store/9nxyqw4vxi4q7258ynz62awfa0dxd4di-bash-5.2-p15/bin/bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file or directory
treefmt-check> ERROR: Unable to locate the projectRootFile (justfile) in any of: '/private/tmp/nix-build-treefmt-check.drv-0/project' '/private/tmp/nix-build-treefmt-check.drv-0' '/private/tmp' '/private' '/'

Looks like it doesn't have the context of parent folder contents.