-
Notifications
You must be signed in to change notification settings - Fork 387
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
CLDR-15381 Java formatting with prettier, tabWidth 4, printWidth 120 #1919
Conversation
-Add .prettierrc.json with custom settings for .java files -Only java files in tools/cldr-code/src/main/java/org/unicode/cldr/util
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.
generally LGTM…
"🚴♂️", | ||
"🚴🏿♂️", | ||
"🚴♀️", | ||
"🚴🏿♀️" |
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.
still blew it out to 22 lines
final String shortName = eng.getShortName(s); | ||
final Set<String> keywords = eng.getKeywords(s); | ||
System.out.println("{\"" + s + "\",\"" + shortName + "\",\"" + Joiner.on("|") | ||
.join(keywords) + "\"},"); | ||
System.out.println("{\"" + s + "\",\"" + shortName + "\",\"" + Joiner.on("|").join(keywords) + "\"},"); |
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.
… but generally, it's not mangling these lines anymore
0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0x2000, 0xf800, 0xf800, 0xf800, 0xf800 | ||
0, |
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.
uggg. Any way to manually override (eg with comments) to prevent mangling? We shouldn't have to make code changes just because of a pretty printer!
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.
If I use // @Formatter:off and // @Formatter:on, it works well.
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.
"// @Formatter:off and // @Formatter:on" -- that looks promising
maybe that wouldn't be needed very often; the utf16Fixup array is unusual due to the performance optimization
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.
actually "@Formatter" doesn't work for me, but "// prettier-ignore" does, for java, although the documentation is for javascript:
@macchiati @btangmu prettier is explicitly an opinionated formatter. per https://prettier.io/docs/en/option-philosophy.html
perhaps we need to look for something else, at least for the java side. I think it's been pretty uch 100% perfect for the JS side. |
-Add .prettierrc.json with custom settings for .java files
-Only java files in tools/cldr-code/src/main/java/org/unicode/cldr/util
CLDR-15381