Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: format integration tests #3002

Closed
wants to merge 1 commit into from

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves

Summary*

This PR runs the formatter over the integration test suite to flag up any issues.

  1. The nested for-loops in 6_array causes a panic due to start>end when slicing.
  2. Due to not handling all statements/expressions, we're getting some funky indentation. (see 1327_concrete_in_main)

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Comment on lines -16 to +17
) -> pub [Field; 2] {
) -> pub [Field; 2]
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a bit of an odd choice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Could we change this in the formatter?

Comment on lines +8 to +9
(
i as u8 + j as u8 + k as u8 + x + y + z
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I like the removal of parentheses here. Also one is getting stranded on the previous line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is broken imo. The stranded paren just adds confusion.

if a != 1 { // Change `a` in Prover.toml to test input `b`
if a != 1 { // Change `a` in Prover.toml to test input `b`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, the other lines are indented by 5

@@ -7,6 +7,5 @@ fn main(arr: [Field; ARRAY_LEN], x: u32) -> pub Field {
value += arr[0 as u32];
value += arr[1 as Field];

value + (x as Field)

value + x as Field
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, lack of parentheses make this ambiguous imo.

@TomAFrench TomAFrench marked this pull request as draft October 5, 2023 17:26
@TomAFrench
Copy link
Member Author

fyi @f01dab1e (Thank you for the work on the formatter btw!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Test 6" in this file panics. Looks to be something to do with nested for-loops

@TomAFrench TomAFrench closed this Oct 31, 2023
@TomAFrench TomAFrench deleted the tf/format-integration-tests branch November 20, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants