Skip to content

Add assertion for missing fixed source #1549

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

Merged

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Apr 14, 2023

As in #1467 I also tough here it would start to make sense to test the applied the fix its as it will ensure the quality in many different cases and scenarios.

So when there is 1 or more fix its we expect a fixed source.
What do you think. Is it worth it?

Just before I continue with the rest of the 195 failing test cases 🫣

@kimdv kimdv requested a review from ahoppen as a code owner April 14, 2023 22:11
@ahoppen
Copy link
Member

ahoppen commented Apr 14, 2023

As with my comment on the other PR, I think that it’s a great change and allows everybody to explicitly write down their expectation. I certainly remember a bug or two that would have been caught if we had written down the fixed source straight away.

@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch 7 times, most recently from 40e3036 to ed090a5 Compare April 17, 2023 09:27
@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch from ed090a5 to d502408 Compare April 18, 2023 20:18
Copy link
Contributor Author

@kimdv kimdv left a comment

Choose a reason for hiding this comment

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

A bit less than 150 missing fix its. 😬
Added some online comments that could be worth considering

Comment on lines 440 to 441
fixedSource: """
@_expose(Cxx, ""baz) func foo() {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks odd. Should the fixed source not be like @_expose(Cxx, "baz") func foo() {}

Comment on lines 493 to 496
fixedSource: """
@_unavailableFromAsync(messagenope: "abc")
func foo() {}
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should the attribute not be @_unavailableFromAsync(message: "abc")

Comment on lines 508 to 511
fixedSource: """
@_unavailableFromAsync(message: ""= "abc")
func foo() {}
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should the attribute not be @_unavailableFromAsync(message: "abc")

Comment on lines 524 to 525
@_unavailableFromAsync(message: ""abc)
func foo() {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above, I would expect that abc got wrapped in the ""

actor MyActor2 {
init() {
}
func hello() { }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we here add the } on a new line?

]
],
fixedSource: """
func foo(first second: third) struct <#identifier#>: Int) {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we miss a ; between the function and struct

]
],
fixedSource: """
func foo(first second: [third] fourth: Int) {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe a good first issue to add a comma after [third]

]
],
fixedSource: #"""
@_originallyDefinedIn(modulemodulename: "foo", OSX 13.13)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would expect modulename was replaced by module here

// Parse errors
for i in r {
}
for i in r { sum = sum + i;}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe newline after { and before }

@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch from d502408 to 7b6b65b Compare April 19, 2023 14:14
@kimdv
Copy link
Contributor Author

kimdv commented Apr 19, 2023

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Wow, that’s a big PR. And thanks for catching all those incorrect formattings. I think most of the space-related issues should be fixed in the next couple of days by my changes to BasicFormat. All the other ones look like real problems to me. Shows that requiring you to specify fixedSource does provide value 🤩 .

What do you think about the following? We wait for my BasicFormat changes to get in and see which tests are still odd after that. For all of those, you file issues on GitHub (and feel free to mark them as “good first issue” if you think they’ll be easy to fix) and reference those issues as TODOs in the test cases.

@kimdv
Copy link
Contributor Author

kimdv commented Apr 20, 2023

Wow, that’s a big PR. And thanks for catching all those incorrect formattings. I think most of the space-related issues should be fixed in the next couple of days by my changes to BasicFormat. All the other ones look like real problems to me. Shows that requiring you to specify fixedSource does provide value 🤩 .

Yes it gives a lot 🙌

What do you think about the following? We wait for my BasicFormat changes to get in and see which tests are still odd after that. For all of those, you file issues on GitHub (and feel free to mark them as “good first issue” if you think they’ll be easy to fix) and reference those issues as TODOs in the test cases.

Let's wait yes, there will 100% be cases that are fixed now.
I will go trough the other files and open issues 😁

@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch 2 times, most recently from 819c718 to 1ade024 Compare April 23, 2023 17:45
@kimdv kimdv requested a review from ahoppen April 23, 2023 17:45
@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch 3 times, most recently from 97ee944 to b23d0f5 Compare April 25, 2023 19:42
@kimdv
Copy link
Contributor Author

kimdv commented Apr 25, 2023

@ahoppen it's now rebased on latest main and all swift parser tests passes locally.

@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch 3 times, most recently from 2d0c998 to 48d25f6 Compare April 26, 2023 18:45
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thank you for pushing through all of these test cases. I have added comments to all the tests that would deserve a GitHub issue. Some of the comments can probably be bundled into a single issue. If you could file those, that’d be great.

I also don’t think that we need to add TODOs to the codebase, the issues are sufficient.

Feel free to merge this whenever you get it passing without racing other PRs.

And I don’t think we need to cherry-pick this to release/5.9.

@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch from 48d25f6 to b42d76b Compare April 28, 2023 07:06
@kimdv kimdv force-pushed the kimdv/add-assertion-for-missing-fixed-source branch from aa84fcd to 6261d79 Compare April 29, 2023 09:02
@kimdv
Copy link
Contributor Author

kimdv commented Apr 29, 2023

@swift-ci please test

@kimdv
Copy link
Contributor Author

kimdv commented Apr 29, 2023

@swift-ci please test windows

@kimdv kimdv merged commit 46701ae into swiftlang:main Apr 29, 2023
@kimdv kimdv deleted the kimdv/add-assertion-for-missing-fixed-source branch April 29, 2023 11:22
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