Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use platform specific line separator in gen-l10n #130090

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
merged 5 commits into from
Jul 12, 2023

Conversation

thkim1011
Copy link
Contributor

Currently files are not generated with \r\n in windows. This PR should fix the issue.

Fixes #109761.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 6, 2023
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io';
Copy link
Contributor

Choose a reason for hiding this comment

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

@AlexV525
Copy link
Member

AlexV525 commented Jul 7, 2023

One thing we should consider is whether the repo (if it's version-controlled by Git) is configured as CRLF or LF, because there are multiple options when checking out files on Windows, such as "Checkout as-is, Commit as-is" and "Checkout Windows-style, Commit Unix-style".

@christopherfujino
Copy link
Contributor

christopherfujino commented Jul 7, 2023

One thing we should consider is whether the repo (if it's version-controlled by Git) is configured as CRLF or LF, because there are multiple options when checking out files on Windows, such as "Checkout as-is, Commit as-is" and "Checkout Windows-style, Commit Unix-style".

Yeah, it seems to me like there isn't one universally correct solution for all Windows users.

Apparently the command git ls-files --eol will list all files in the repo and eol style it uses in the local checkout: https://stackoverflow.com/questions/35801024/how-to-see-what-type-of-line-endings-are-already-in-git-repository.

However, on my windows machine, where I'm pretty sure I have git configured to "Checkout Windows-style, Commit Unix-style", I have a mixture of w/lf and w/crlf, so idk what's going on.

One thing we could do is add a flag, and let this be user configurable.

@thkim1011
Copy link
Contributor Author

@AlexV525 @christopherfujino I changed it so that the generated files uses the same line terminator as that of pubspec.yaml which I think is the cleanest way to do this? Thoughts on this?

@AlexV525
Copy link
Member

AlexV525 commented Jul 8, 2023

@AlexV525 @christopherfujino I changed it so that the generated files uses the same line terminator as that of pubspec.yaml which I think is the cleanest way to do this? Thoughts on this?

Should be great enough IMO. +1. Could we document it somewhere?

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@thkim1011 thkim1011 merged commit d75735e into flutter:master Jul 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 13, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 13, 2023
flutter/flutter@544d30d...c40173f

2023-07-13 [email protected] Revert "Roll Flutter Engine from 16e2ab7e986c to 1b1ccdd1f527 (13 revisions)" (flutter/flutter#130479)
2023-07-13 [email protected] Roll Flutter Engine from 16e2ab7e986c to 1b1ccdd1f527 (13 revisions) (flutter/flutter#130458)
2023-07-13 [email protected] Exclude `Tooltip`'s overlay child from SelectableRegion (flutter/flutter#130181)
2023-07-12 [email protected] Update `Checkbox` tests for M2/M3 (flutter/flutter#130351)
2023-07-12 [email protected] Refactor JSNumber.toDart and Object.toJS (flutter/flutter#129436)
2023-07-12 [email protected]  Reland [a11y] CupertinoSwitch On/Off labels (flutter/flutter#130173)
2023-07-12 [email protected] Add missing links to examples that aren't linked anywhere (flutter/flutter#130422)
2023-07-12 [email protected] Use platform specific line separator in gen-l10n (flutter/flutter#130090)
2023-07-12 [email protected] Update `Divider`/`VerticalDivider` and theme tests for M2/M3 (flutter/flutter#130415)
2023-07-12 [email protected] Roll Flutter Engine from 5c887028810d to 16e2ab7e986c (2 revisions) (flutter/flutter#130421)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 13, 2023
Currently files are not generated with `\r\n` in windows. This PR should
fix the issue.

Fixes flutter#109761.
auto-submit bot pushed a commit that referenced this pull request Jan 10, 2024
Fixes #139138

This had been broken since #130090 merged, however, the test happened run with flutter_tools/pubspec.yaml in the current working directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gen_l10n] Generated files should respect the platform's line separator
3 participants