-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
build: workaround to run presubmit.sh on Windows #11096
Conversation
@@ -1220,8 +1220,9 @@ Can't have multiple template bindings on one element. Use only one attribute nam | |||
}); | |||
|
|||
it('should report when mix of template and *attrs are used on the same element', () => { | |||
expect(() => parse('<div template="ngIf" *ngFor>', [])).toThrowError(`Template parse errors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, you can also disable clang-format for a section:
// clang-format off
code goes here
// clang-format on
LGTM |
Re formatting issues, just speculating, maybe this is caused by your git checkout using windows line endings, and clang-format miscounts Can you be a bit more precise in what you mean with "On top of that, this version has issues with back-tick strings. It tries to format the content and does it in different ways depending on the OS."? |
On a Mac, I've tried to upgrade to 1.0.43, here are the results: https://github.com/mlaval/angular/tree/clang1.0.43 If I take this branch on a Windows machine and run clang-format, it creates even more changes on these strings (can't share them right now). I'll take another look at Windows environment next week. It could definitely be a line ending thing. |
I see. Those changes are WAI, Can you produce a minimal example of a source code snippet that formats differently on Windows vs Mac / Linux? |
@mprobst you are right, EOL was an issue. Forcing LF on Windows solves the problem that I had. This PR was in fact useless. About clang 1.0.43, I can still see differences between Mac and Windows, even with the right EOL.
|
Could you post a short piece of TypeScript code that formats differently on
Mac vs Windows, i.e. a repro case?
|
I added one commit with 2 repro cases for 1.0.43: marclaval@9f705e1 Both were formatted on Windows, and both are not considered correctly formatted on Mac. |
Thanks Marc, I'll TAL! Marc Laval notifications@github.com schrieb am Mo., 29. Aug. 2016 um
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR is a workaround to be able to run
./presubmit.sh
successfully on Windows.There is a conflict on this precise line of code. On windows, clang-format wants to split it on 2 lines. On Mac it wants to keep it on one line.
Making the line one character longer brings the two to an agreement: 2 lines.
@mprobst this is still happening with version 1.0.43 of clang-format.
On top of that, this version has issues with back-tick strings. It tries to format the content and does it in different ways depending on the OS.