Skip to content

Commit

Permalink
chore(formatter): prettier test diff output via similar-asserts (#3046
Browse files Browse the repository at this point in the history
)

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
  • Loading branch information
kek kek kek and TomAFrench authored Oct 9, 2023
1 parent 7e68976 commit 0bc2e4d
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 14 deletions.
144 changes: 133 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tooling/nargo_fmt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ noirc_frontend.workspace = true
serde.workspace = true
toml.workspace = true
thiserror.workspace = true

[dev-dependencies]
similar-asserts = "1.5.0"
2 changes: 1 addition & 1 deletion tooling/nargo_fmt/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn format_{test_name}() {{
let fmt_text = nargo_fmt::format(&input, parsed_module, &config);
assert_eq!(fmt_text, expected_output);
similar_asserts::assert_eq!(fmt_text, expected_output);
}}
"##
)
Expand Down
3 changes: 1 addition & 2 deletions tooling/nargo_fmt/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#![forbid(unsafe_code)]
#![warn(unused_crate_dependencies, unused_extern_crates)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![warn(unused_qualifications, clippy::use_self)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

/// A Rust code formatting utility designed to manage and format untouched fragments of source code,
/// including comments, whitespace, and other characters. While the module doesn't directly address comments,
Expand Down

0 comments on commit 0bc2e4d

Please sign in to comment.