Skip to content

Conversation

@gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Jul 13, 2018

There are only whitespace changes here, except for packages/flutter/test/foundation/licenses_test.dart, where I replace some raw whitespace (line feed) with their unicode equivalents.

I'm adding a presubmit check for this in #19412.

Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we also include ".m" and ".mm"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we only check files that are changed in the PR? That way, the check could be faster and we don't have to remove all the trailing spaces in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a good idea. It also means that we won't encounter false-positive issues in generated files.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this. Copied to my PR: flutter/engine#5733

@gspencergoog gspencergoog force-pushed the trailing_whitespace branch from 12bd1ea to e65789a Compare July 13, 2018 23:57
@gspencergoog
Copy link
Contributor Author

OK, PTAL. The code now only checks for whitespace on changed files.

@gspencergoog gspencergoog force-pushed the trailing_whitespace branch from e65789a to 6165345 Compare July 14, 2018 02:39
@liyuqian
Copy link
Contributor

The code looks good to me. However, some tests are failing... It seems that the branch master is not available on some test bots, and some unit tests are matching texts on those that we changed the white spaces. Maybe we can revert all those white spaces changes in this PR so it can pass the test, and then remove trailing spaces and refactor unit tests later?

@gspencergoog gspencergoog changed the title Removes trailing whitespace from source files, adds a presubmit check for it. Removes trailing whitespace from source files. Jul 16, 2018
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. You can't tell from the diff, but there were raw formfeed characters in between the I and the J. I just changed these to make them more obvious and explicit. Same for the other lines in this file.

@gspencergoog
Copy link
Contributor Author

OK, I moved the presubmit check to #19412. I'll address the lack of a master branch there.

@gspencergoog gspencergoog force-pushed the trailing_whitespace branch from 9c8180f to 516b85b Compare July 16, 2018 17:17
@gspencergoog gspencergoog force-pushed the trailing_whitespace branch from 516b85b to d52a951 Compare July 19, 2018 20:03
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning
in Xcode and create an iOS Development Certificate as well as a Provisioning\u0020
Copy link
Contributor

Choose a reason for hiding this comment

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

why?

Copy link
Contributor Author

@gspencergoog gspencergoog Jul 20, 2018

Choose a reason for hiding this comment

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

Because this line has an embedded space in the test, but I didn't want to just remove it, because it appeared that it was just mocking something that the real iOS tools output.

So I converted it to an escape sequence so that the whitespace presubmit check I have in the other PR won't fail because there's a space here. I'd really prefer a linter rule for EOL whitespace, but it doesn't exist yet.

I'm happy to just fix the test and remove the whitespace if you think that won't be a problem. If I did that, I'd just remove the last part of the string in the test.

@gspencergoog gspencergoog merged commit 1cc0365 into flutter:master Jul 20, 2018
@gspencergoog gspencergoog deleted the trailing_whitespace branch October 5, 2018 01:29
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants