Skip to content

Files starting with .. treated as outside tree root #700

@ndrpnt

Description

@ndrpnt

Describe the bug

Files whose name starts with .. (2 dots) seem to be incorrectly treated as outside of the tree root.

To Reproduce

Steps to reproduce the behavior:

$ cd $(mktemp -d)
$ touch treefmt.toml foo.json ..bar.json
$ ls -A
..bar.json      foo.json        treefmt.toml
$ nix run nixpkgs#treefmt -- foo.json
traversed 1 files
emitted 0 files for processing
formatted 0 files (0 changed) in 67ms
$ nix run nixpkgs#treefmt -- ..bar.json
Error: failed to create walker: path ..bar.json not inside the tree root /private/var/folders/6z/jh9wgqld10gc2gwtt3gxy3180000gn/T/tmp.AeTNWzKKsV (relative path: ..bar.json)

Expected behavior

I expected foo.json and ..bar.json to be formatted equally.

System information

treefmt v2.5.0 on macOS.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions