Skip to content

Conversation

Sajjon
Copy link
Contributor

@Sajjon Sajjon commented Jul 7, 2024

Fix typos in misc folders: cmake, tools, utils, unittests, validation-test + more

This is one batch of many PRs fixing typos, see the tracking issue.

Dictionary(threadCurrentTasks.map{ ($1, $0) }, uniquingKeysWith: { $1 })

var lastChilds: [Bool] = []
var lastChildren: [Bool] = []
Copy link
Member

Choose a reason for hiding this comment

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

While grammatically incorrect, I think that in general, this type of change is less desirable as it is changing terminology for variables rather than correcting an obvious typo. In this specific case, the rename is fine, but it is not always so obvious.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1. This array isn't an array of children. It's an array of "last child" flags. lastChildren is wrong. A better name might be lastChildFlags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

hasOption = optionSet.find("-clearly-not-a-compiler-flag") != optionSet.end();
EXPECT_EQ(hasOption, false);
hasOption = optionSet.find("-emit-modul") != optionSet.end();
hasOption = optionSet.find("-emit-module") != optionSet.end();
Copy link
Member

Choose a reason for hiding this comment

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

Wow, this has never triggered an error? Seems like we have insufficient test coverage :(

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is intentional, as it's followed by EXPECT_EQ(hasOption, false); and this test seems to be about arguments that don't exist. I assume it's meant to be very close to a real argument name, maybe to ensure nothing is doing a prefix match or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mikeash makes sense, I will revert the change then?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mikeash fixed!

}
struct EqualWitdthHStack : TestLayout {}
extension EqualWitdthHStack: View {
struct EqualWidthHStack : TestLayout {}
Copy link
Member

Choose a reason for hiding this comment

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

Again, these types of changes should be avoided IMO. In this specific case, this is a test program so it doesn't matter, but this runs the risk of an ABI break.

@compnerd
Copy link
Member

compnerd commented Jul 7, 2024

@swift-ci please test

Co-authored-by: Saleem Abdulrasool <[email protected]>
@compnerd
Copy link
Member

compnerd commented Jul 7, 2024

@swift-ci please test

Copy link
Contributor

@al45tair al45tair left a comment

Choose a reason for hiding this comment

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

lastChildren should be lastChildFlags instead, I think. Or just leave it alone.

Dictionary(threadCurrentTasks.map{ ($1, $0) }, uniquingKeysWith: { $1 })

var lastChilds: [Bool] = []
var lastChildren: [Bool] = []
Copy link
Contributor

Choose a reason for hiding this comment

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

+1. This array isn't an array of children. It's an array of "last child" flags. lastChildren is wrong. A better name might be lastChildFlags.

@al45tair
Copy link
Contributor

al45tair commented Jul 8, 2024

@swift-ci Please test

...
... /// A `Collection` whose elements consist of those in a `Base`
... /// `Collection` passed through a transform function returning `Elemen
... /// `Collection` passed through a transform function returning `Element
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, the closing "`" is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

...
... /// A `Collection` whose elements consist of those in a `Base`
... /// `Collection` passed through a transform function returning `Elemen
... /// `Collection` passed through a transform function returning `Element
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

...
... /// A `Collection` whose elements consist of those in a `Base`
... /// `Collection` passed through a transform function returning `Elemen
... /// `Collection` passed through a transform function returning `Element
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

Found one that I think is supposed to be misspelled. Everything else looks good.

hasOption = optionSet.find("-clearly-not-a-compiler-flag") != optionSet.end();
EXPECT_EQ(hasOption, false);
hasOption = optionSet.find("-emit-modul") != optionSet.end();
hasOption = optionSet.find("-emit-module") != optionSet.end();
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is intentional, as it's followed by EXPECT_EQ(hasOption, false); and this test seems to be about arguments that don't exist. I assume it's meant to be very close to a real argument name, maybe to ensure nothing is doing a prefix match or something like that?

@al45tair
Copy link
Contributor

al45tair commented Jul 9, 2024

@swift-ci Please test

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.

6 participants