numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
268 stars 82 forks source link

The just formatter always updates the timestamp #265

Open jwillikers opened 4 days ago

jwillikers commented 4 days ago

Describe the bug

The just formatter always updates the timestamp of the file regardless of whether the file is changed or not.

DEBU formatter | just: executing: /nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash -euc for f in "$@"; do
  /nix/store/qj4vq5wqbjirx4x8l5z3w9wjgl8da4w6-just-1.36.0/bin/just --fmt --unstable --justfile "$f"
done
 -- .justfile
INFO formatter | just: 1 file(s) processed in 21.883899ms
DEBU file has changed path=.justfile prev_size=1266 prev_mod_time="2024-11-22 08:28:16 -0600 CST" current_size=1266 current_mod_time="2024-11-22 08:37:27 -0600 CST"
traversed 87 files
emitted 1 files for processing
formatted 1 files (1 changed) in 68ms

To Reproduce

Steps to reproduce the behavior:

  1. Format once: treefmt-nix -c --formatters=just --verbose=2
  2. Format again: treefmt-nix -c --formatters=just --verbose=2

Expected behavior

The file should not be reported as changed when it hasn't been.

System information

just is version 1.36.

Additional context

zimbatm commented 4 days ago

/cc @jbott

This should be brought up upstream ideally

jwillikers commented 3 days ago

This should be brought up upstream ideally

I've opened casey/just#2478

jwillikers commented 2 days ago

Fixed upstream in https://github.com/casey/just/pull/2479