Comments (12)
https://ci.appveyor.com/project/eaftan/google-java-format/build/1.0.2
from google-java-format.
Two tests in DiagnosticTest
fail on Windows due to hard-coded line separators in combination with java.io.PrintWriter
dynamic behaviour:
/**
* Line separator string. This is the value of the line.separator
* property at the moment that the stream was created.
*/
private final String lineSeparator;
How do you want it to be fixed?
- remove
\n
from end of expected string and usecontains
instead ofisEqualTo
assertThat(err.toString()).contains("<stdin>:2:4: error: Invalid character constant");
- replace
\n
withSystem.lineSeparator()
assertThat(err.toString()).isEqualTo("<stdin>:2:4: error: Invalid character constant" + System.lineSeparator());
?
See #40
from google-java-format.
I recently suggested in junit-team/junit5#398 the use of AppVeyor to prevent these sorts of Windows-related errors from cropping up in the future.
What does the google-java-format team think about using AppVeyor here?
from google-java-format.
AppVeyor would report: Tests run: 509, Failures: 270, Errors: 0, Skipped: 1
... all CRLF
related.
from google-java-format.
Haha, well then! Looks like a pretty convincing case for using AppVeyor to me.
from google-java-format.
After converting all .[in|out]put
files to \n
line separators, the test reports: Tests run: 507, Failures: 15, Errors: 0, Skipped: 1
Maybe a .gitattributes
could help:
*.input -text
*.output -text
The remaining 15 failures are extra \n
characters where none are expected. Like in MainTest.importRemovalLines
, there's an empty line rendered between the import
and class
block.
from google-java-format.
#79 proposes a dynamic way for the line separator issue, which does not override the user choice of which line separator to use.
If the line separator used in output should be forced/user-defined, may be, another command line option can be introduced using an enum named OutputLineSeparator
:
- AUTO_DETECT // use the separator used in input, implemented in #79
- DEFAULT // use the system-dependend default separator via System.lineSeparator()
- UNIX // force "\n"as line separator
- MAC // force "\r" as line separator
- WINDOWS / force "\r\n" as line separator
from google-java-format.
Now, travis and local Windows machine agree: Tests run: 517, Failures: 0, Errors: 0, Skipped: 1
from google-java-format.
If only Travis starts a build and there was a AppVeyor build ... this issue was solved. (-:
from google-java-format.
Ooh, great to see an AppVeyor build up and running! Thank you @eaftan and @cushon.
from google-java-format.
Thank you guys for letting us know about AppVeyor. We've been looking for a Windows CI solution for several of our projects.
from google-java-format.
You're very welcome @eaftan. 👍
I look forward to seeing it being adopted across more Google OSS projects.
from google-java-format.
Related Issues (20)
- String Templates Formatting for """ Multi-Line is "not nice" HOT 4
- Does not work in InteliJ client
- Unnamed pattern cannot be parsed
- The unused method cannot be detected HOT 2
- Import Ordering configuration suppressed on README HOT 2
- help HOT 4
- Version 1.20.0 hasn't been published to MavenCentral HOT 1
- 1.20.0 binaries reports incorrect version (HEAD-SNAPSHOT) when called with the -v flag HOT 2
- Request google-java-format IntelliJ plugin version 1.18 HOT 1
- Before commit reformatting option in IntelliJ does invoke plugin
- google-java-format_linux-x86-64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./google-java-format_linux-x86-64) HOT 6
- The google-java-formatter eclipse plugin doesn't change the format of my code HOT 2
- IllegalAccessError from com.sun.tools.javac.util
- Omit the redundant method isReal() to make it simpler
- Excess indentation with method-receiving text blocks HOT 2
- compatibility with Gradle 9.x
- Inconsistent blank line between license and package statement HOT 1
- Inconsistent formatting of text blocks in 1.21.0 HOT 7
- bug report: 1.21.0 IntelliJ vs jar inconsistency HOT 3
- Misleading message for --dry-run with --replace
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-java-format.