nargo fmt: inconsistent formatting with arrays
Aim
Run fmt on
dep::std::hash::pedersen_hash_with_separator([
contract_address.to_field(),
storage_slot
], GENERATOR_INDEX__PUBLIC_LEAF_INDEX)
Expected Behavior
dep::std::hash::pedersen_hash_with_separator([
contract_address.to_field(),
storage_slot
], GENERATOR_INDEX__PUBLIC_LEAF_INDEX)
Or
dep::std::hash::pedersen_hash_with_separator(
[
contract_address.to_field(),
storage_slot
],
GENERATOR_INDEX__PUBLIC_LEAF_INDEX
)
Bug
The formatted code looks like
dep::std::hash::pedersen_hash_with_separator(
[
contract_address.to_field(),
storage_slot
],
GENERATOR_INDEX__PUBLIC_LEAF_INDEX
)
To Reproduce
- Run nargo fmt
Installation Method
None
Nargo Version
No response
Additional Context
Saw the issue as part of https://github.com/AztecProtocol/aztec-packages/pull/3803/files/c6f4b7b9b9efe9a118e57aec0f28219523812563
Would you like to submit a PR for this Issue?
No
Support Needs
No response
I tried to use the master branch of noir (version 219423eb87fa12bd8cca2a6fd2ce4c06e308783c) instead of the aztec one to see if the issues pertain and unfortunately they do.
2 more issue I've stumbled upon.
- When I put 2 spaces after "fn" the formatter leaves it as it is:
fn main(input: PrivateKernelInputsInner) -> distinct pub KernelCircuitPublicInputs { input.native_private_kernel_circuit_inner() }
- It doesn't format spaces in dependencies:
use dep:: protocol_types::{ address::AztecAddress, abis::function_selector::FunctionSelector, };
The formatter ignores spaces in struct functions:
@f01dab1e can you take this on?
I'll have a look on Monday.