You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If topiary format is run in a directory that contain symlinks to files that need formatting, then Topiary will format the contents of the target and then replace the symlink with that formatted target (i.e., as a regular file).
To Reproduce
$ mkdir test
$ echo' { "foo": "bar"} '> test/foo.json
$ ln -s foo.json test/bar.json
$ ls -l testtotal 4lrwxrwxrwx 1 chris users 8 Jan 16 10:13 bar.json -> foo.json-rw-r--r-- 1 chris users 22 Jan 16 10:13 foo.json
$ topiary format test
$ ls -l testtotal 8-rw------- 1 chris users 17 Jan 16 10:14 bar.json-rw------- 1 chris users 17 Jan 16 10:14 foo.json
Expected behavior
Two options, perhaps controllable via a command line option:
Skip over symlinks (default)
Format any symlinks' targets, leaving the symlink intact
Environment
OS name + version: NixOS 24.11
Version of the code: 0.5.1
Additional context
A similar problem happens with hardlinks; that is, the link is broken. Unlike the symlink case, I'm not quite sure how this can be fixed.
The text was updated successfully, but these errors were encountered:
Describe the bug
If
topiary format
is run in a directory that contain symlinks to files that need formatting, then Topiary will format the contents of the target and then replace the symlink with that formatted target (i.e., as a regular file).To Reproduce
Expected behavior
Two options, perhaps controllable via a command line option:
Environment
Additional context
A similar problem happens with hardlinks; that is, the link is broken. Unlike the symlink case, I'm not quite sure how this can be fixed.
The text was updated successfully, but these errors were encountered: