Skip to content

Commit

Permalink
Clarify in the spec that the formatter MUST process the given files
Browse files Browse the repository at this point in the history
Some formatters are aware of VCS systems like git, and "helpfully" skip
over files that are not tracked by the VCS system. This doesn't play
nicely with treefmt, because treefmt expects to be able to generate
tempfiles (which are not tracked by a VCS) and pass them to the
formatter.
  • Loading branch information
jfly committed Oct 11, 2024
1 parent 714cf33 commit e47674d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/formatter-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ $ rustfmt --edition 2018 src/main.rs src/lib.rs
```

> [!IMPORTANT]
> It _MUST_ process the specified files. For example, it _MUST_ NOT ignore files because they are not tracked by a VCS.
>
> It _SHOULD_ processes only the specified files. Files that are not passed _SHOULD_ never be formatted.
### 2. Write to changed files
Expand Down

0 comments on commit e47674d

Please sign in to comment.