chore: add noirfmt.toml to noir-contracts and run nargo fmt#22971
Merged
Conversation
23af522 to
b12f703
Compare
vezenovm
reviewed
May 5, 2026
vezenovm
left a comment
Contributor
There was a problem hiding this comment.
This is an instance where https://linear.app/aztec-labs/issue/F-607/adopt-cargo-insta-for-noir-contract-snapshot-testing would be useful. We are only change the formatting and thus should see no differences in our snapshots.
Contributor
There was a problem hiding this comment.
Only non-fmt change in this PR
Collaborator
Author
|
❌ Failed to cherry-pick to |
benesjan
added a commit
that referenced
this pull request
May 6, 2026
Backport of #22971 to `backport-to-v4-next-staging`. Auto cherry-pick failed on 5 files due to v4-next semantic drift from `merge-train/fairies`. Resolved manually using the 3-commit backport pattern. ## Conflicts resolved | File | Resolution | |---|---| | `nft_contract/src/types/nft_note.nr` | keep v4-next (no `compute_note_hash` direct usage) | | `protocol/auth_registry_contract/src/main.nr` | keep v4-next (expanded-macro form) | | `protocol/contract_class_registry_contract/src/validate_bytecode.nr` | keep v4-next (PR base has additional tests not yet here) | | `test/note_hash_and_nullifier/.../test_note.nr` | keep v4-next (uses `poseidon2_hash_with_separator` directly) | | `test/test_log_contract/src/test/tx_effects.nr` | keep deleted (already removed on v4-next) | The PR is fmt-only, so wherever v4-next has different content, that content is preserved and `nargo fmt` is re-run with the new `noirfmt.toml` so the result is internally consistent. ## Commits (preserved per backport rules) 1. `chore: add noirfmt.toml to noir-contracts and run nargo fmt (cherry-pick #22971)` — cherry-pick AS-IS with conflict markers (does not compile by design) 2. `fix: resolve cherry-pick conflicts by keeping v4-next-staging content` 3. `chore: re-run nargo fmt with new noirfmt.toml config` ## Verification - `nargo fmt --check` clean in `noir-projects/noir-contracts/` - 117 files changed (matches PR scope: noirfmt.toml + 116 .nr files) - No conflict markers, `.rej`, or `.orig` files remain Detailed analysis: https://gist.github.com/AztecBot/dabe6018f40af2369cec56de821510f3 ClaudeBox log: https://claudebox.work/s/a0fd76c8e05d8ddb?run=1
benesjan
added a commit
that referenced
this pull request
May 7, 2026
This PR accumulates backport commits and will be auto-merged overnight. Backports included: - #22977 - chore: backport noirfmt.toml + nargo fmt (#22971) to v4-next - #22958 - chore: backport pxe db schema compatibility test (#22872) to v4-next > Created manually because the auto-cherry-pick step failed for both source PRs (#22971, #22872) due to conflicts; the manual fix-up PRs bypassed the script that normally opens this PR. 🤖 This PR is normally managed automatically by the backport workflow.
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
May 16, 2026
BEGIN_COMMIT_OVERRIDE refactor: `getPackageVersion` fn cleanup (AztecProtocol#22941) fix(ci): skip acceptance test for canary -commit. tags (AztecProtocol#22951) fix: closing db, correct stub side effects (AztecProtocol#22939) feat: wallet-sdk heartbeat (AztecProtocol#22948) chore: pxe db schema compatibility test (AztecProtocol#22872) feat: stamping aztec version into contract artifacts (AztecProtocol#22550) fix: add aztecVersion to PXE schema_tests fixture (AztecProtocol#22960) feat(pxe): deduplicate class ID verification per contract (AztecProtocol#22966) chore: add noirfmt.toml to noir-contracts and run nargo fmt (AztecProtocol#22971) feat(aztec-nr): Initial handshake registry contract with non interactive handshake function (AztecProtocol#22854) chore: merge next into merge-train/fairies (AztecProtocol#22991) fix(aztec-up): Aztec installer does not shadow user installed binaries on PATH (AztecProtocol#22902) test(ci): drop e2e_kernelless_simulation from backwards-compat e2e (AztecProtocol#23005) feat(ci): notify #team-fairies when backwards-compat e2e fails on nightly (AztecProtocol#23006) chore: merge next into merge-train/fairies (AztecProtocol#23021) fix: better DeployMethod (AztecProtocol#22985) refactor(pxe): batch RPC calls for note and event validation (AztecProtocol#22988) END_COMMIT_OVERRIDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nargo fmtwas using compiler defaults onnoir-projects/noir-contracts/(nonoirfmt.toml), so long comments stayed unwrapped and the directory drifted stylistically fromaztec-nr/, which already opts intomax_width=120+wrap_comments=true.This PR:
noir-projects/noir-contracts/noirfmt.tomlmirroringaztec-nr/noirfmt.toml:nargo fmtover the workspace — 116.nrfiles reformatted (mostly collapsing previously 100-col-wrappeduse { ... }blocks and method chains onto single lines, plus comment wrapping at 120).nargo fmthas an idempotency bug underwrap_comments=truewhere/** ... */and/****/blocks at non-zero indent gain 4 cols of indentation on every fmt run; converting them removes the foot-gun. PerCLAUDE.md's formatting rules,/** doc */blocks become///line comments, banner-style section dividers (/****** Storage ******/) are deleted entirely, and "what" comments that just restate the function name are dropped. Files touched:schnorr_account_contract,nft_contract,private_token_contract,token_contract,avm_test_contract,avm_initializer_test_contract. Noir issue filed here nargo fmt drifts /** */ inner lines with whitespace when wrap_comments=true noir-lang/noir#12552Verification
nargo fmt --checkclean and idempotent innoir-projects/noir-contracts/.noir-projects/noir-contracts/(.nrfiles + the newnoirfmt.toml).Full analysis: https://gist.github.com/AztecBot/5192169a50b51fdc887f05eeed354e43