Skip to content

Commit

Permalink
fix(fmt): forc-fmt check (FuelLabs#4147)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
eightfilms authored Feb 21, 2023
1 parent af634d6 commit ec65188
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions forc-plugins/forc-fmt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn format_workspace_at_dir(app: &App, workspace: &WorkspaceManifestFile, dir: &P

// Finally, format the root manifest using taplo formatter
if let Ok(edited) = format_manifest(app, manifest_file) {
contains_edits = edited;
contains_edits |= edited;
}

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

for file in files {
if let Ok(edited) = format_file(app, file, Some(manifest_file.clone()), formatter) {
contains_edits = edited;
contains_edits |= edited;
};
}
// format manifest using taplo formatter
if let Ok(edited) = format_manifest(app, manifest_file) {
contains_edits = contains_edits || edited;
contains_edits |= edited;
}

if app.check && contains_edits {
Expand Down

0 comments on commit ec65188

Please sign in to comment.