-
Notifications
You must be signed in to change notification settings - Fork 644
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
Fix #441 allowing to build project with Windows #904
Conversation
+ "FROM myTable\n" | ||
+ "Window w1 AS (\n" | ||
"SELECT" | ||
+ System.lineSeparator() |
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.
this seems a little hard to read to me. Can we put each System.lineSeparator()
on the end of the line instead of putting it on a new line?
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.
Yes, I don't like also. But it was done by the formatter plugin that is configurated in maven.
In fact, it separated a lot of lines from the way I initially leave them.
Is it used?
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.
it wouldn't hurt to use a static import so you could just write lineSeparator()
. Even that is too verbose, but you can't fight Java names.
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.
You could make it even shorter by assigning it to a constant at the top of the file like NEW_LINE
One day we'll have Java 13's triple quotes and this will all be cleaner, but it's probably too early for that since Java 11 is the last LTS unless maybe we can just run the tests on Java 13, but compile with Java 11
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.
Yes I can use static import to reduce size, but about the new line I don't like it too.
But is what made the formatter plugin. I suppose that it sees a string concatenation that is two big and wants every concatenation in its new line.
What do you want me to do?
Only static import?
Reformat by hand trying to use fewer lines and ignoring formatter plugin? In that case are there any formatting rules that I must follow?
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.
You shouldn't format by hand. I'm not sure how the other options would look, but they're worth experimenting with
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.
Ok, then I should do just use a static import on all line separators? Any other thing it's needed to be changed?
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.
I would say we should try it and see how it looks
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.
At the end, I use a LINE_END constant that I've seen that was used in some places.
@@ -50,8 +50,7 @@ public void csv() throws IOException { | |||
@Test | |||
public void readUrlWithExtension() throws Exception { | |||
URL url = | |||
mockUrlHelper( | |||
"http://something.other.com/file.csv", ImmutableList.of("region", "canada", "us")); | |||
mockUrlHelper("something.other.com/file.csv", ImmutableList.of("region", "canada", "us")); |
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.
It looks weird to me that http://
is missing. I didn't understand the explanation for why it had to be changed. Is there a fix we can make to mockUrlHelper
or something that will allow http://
to be used?
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.
Changed the mockUrl to be able to use urls
+ // | ||
"};\n", | ||
"var layout = {" | ||
+ lineSeparator() |
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.
this one should be LINE_END
to match the others and then you no longer need the static import
can you rebase this PR? thanks! |
Change System.lineSeparator() for a constant to be less verbose Change mockUrl to be able to use URLs
Can you try adding Windows to the CI so that we avoid regressing? It should just be changing the line below: tablesaw/.github/workflows/ci.yml Line 19 in 56508ba
|
Done |
.github/workflows/ci.yml
Outdated
@@ -17,7 +17,7 @@ jobs: | |||
java-version: [1.8, 11, 15] | |||
# Tests seem to be failing on Windows |
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.
can you remove this line and the next line?
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.
OMG, I didn't see it.
Done
I've seen that build on windows crashes on JAva 15, |
Hmm, that's weird. But sure, go ahead and try changing 15 to 16 |
Thanks for contributing.
Description
Fixes issue #441 allowing to build project with Windows and with systems that don't has en-US as default locale
Changes made:
tablesaw
code, andunivocity
seems to manage BOM but only when aFile
is passed and not aReader
astablesaw
uses.