Skip to content

Commit

Permalink
Deprecate recursive mode
Browse files Browse the repository at this point in the history
The recursive mode has caused problems because it doesn't do any
filtering, which can mess with files in `.git` directories and
elsewhere. While we could support sane implicit filters and an interface
to filter explicitly, that adds complexity and maintenance burden.

Instead, we can promote the use of `treefmt` instead, a "formatting
multiplexer", which supports file filtering by default. So `nixfmt` will
only be the "backend" formatter, while `treefmt` is the frontend.

Previously discussed in a team meeting here:
#151 (comment)
  • Loading branch information
infinisil committed Aug 26, 2024
1 parent 14be7e6 commit ac8a93a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ collectNixFiles path = do
dir <- doesDirectoryExist path
if
| dir -> do
hPutStrLn stderr "\ESC[33mRecursing into directories is deprecated and will be unsupported soon, please use https://treefmt.com/ instead\ESC[0m"
files <- listDirectory path
concat <$> mapM collectNixFiles ((path </>) <$> files)
| ".nix" `isSuffixOf` path -> pure [path]
Expand Down

0 comments on commit ac8a93a

Please sign in to comment.