Skip to content

jfly/2025-01-16-treefmt-pyproject-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple demo for numtide/treefmt#283.

Note how git status is clean:

$ git status
On branch main
nothing to commit, working tree clean

Now run ruff format:

$ nix run nixpkgs#ruff format
1 file left unchanged

Note how git status is still clean:

$ git status
On branch main
nothing to commit, working tree clean

However, if we instead run ruff with treefmt (via nix fmt):

$ nix fmt
2025/01/16 14:44:17 INFO using config file: /nix/store/kyycphhkwi2r0vg2jx4ppdfq1r76awcw-treefmt.toml
WARN no formatter for path: README.md
WARN no formatter for path: pyproject.toml
traversed 6 files
emitted 3 files for processing
formatted 1 files (1 changed) in 26ms

Note how ignore.py got formatted, despite being ignored in pyproject.toml:

$ git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   ignore.py

no changes added to commit (use "git add" and/or "git commit -a")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors