Skip to content

Commit ec65188

Browse files
fix(fmt): forc-fmt check (FuelLabs#4147)
## Description Fixes the same issue found here: FuelLabs#4038 (comment), but missed out in other locations. This has caused new PRs to not fail on `forc-fmt --check` even if they contained formatting violations, see: FuelLabs#4129 ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
1 parent af634d6 commit ec65188

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

forc-plugins/forc-fmt/src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ fn format_workspace_at_dir(app: &App, workspace: &WorkspaceManifestFile, dir: &P
206206

207207
// Finally, format the root manifest using taplo formatter
208208
if let Ok(edited) = format_manifest(app, manifest_file) {
209-
contains_edits = edited;
209+
contains_edits |= edited;
210210
}
211211

212212
if app.check && contains_edits {
@@ -263,12 +263,12 @@ fn format_pkg_at_dir(app: &App, dir: &Path, formatter: &mut Formatter) -> Result
263263

264264
for file in files {
265265
if let Ok(edited) = format_file(app, file, Some(manifest_file.clone()), formatter) {
266-
contains_edits = edited;
266+
contains_edits |= edited;
267267
};
268268
}
269269
// format manifest using taplo formatter
270270
if let Ok(edited) = format_manifest(app, manifest_file) {
271-
contains_edits = contains_edits || edited;
271+
contains_edits |= edited;
272272
}
273273

274274
if app.check && contains_edits {

0 commit comments

Comments
 (0)