We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 918eb6a commit 63b1c55Copy full SHA for 63b1c55
crates/forge/src/cmd/fmt.rs
@@ -127,12 +127,15 @@ impl FmtArgs {
127
let path = source_unit.file.name.as_real();
128
let original = source_unit.file.src.as_str();
129
let formatted = forge_fmt::format_ast(gcx, source_unit, fmt_config.clone())?;
130
+ let from_stdin = path.is_none();
131
- if original == formatted {
132
+ // If no diff then continue only if source loaded from stdin.
133
+ // <https://github.com/foundry-rs/foundry/issues/11871>
134
+ if original == formatted && (!from_stdin || self.check || self.raw) {
135
return None;
136
}
137
- if self.check || path.is_none() {
138
+ if self.check || from_stdin {
139
let summary = if self.raw {
140
formatted
141
} else {
0 commit comments