-
Notifications
You must be signed in to change notification settings - Fork 460
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 spotlessFiles parameter tests #737
Conversation
d276701
to
90f1f1d
Compare
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.
Hmmm... the unix tests were passing, but now they are failing. I see your point about the parens being interpreted as literal, I'm not sure why this worked before, but it did.
} | ||
|
||
private boolean isOnWindows() { | ||
return System.getProperty("os.name").startsWith("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.
I would use
spotless/lib/src/main/java/com/diffplug/spotless/FileSignature.java
Lines 112 to 115 in 5d965e7
/** Returns true if this JVM is running on a windows machine. */ | |
public static boolean machineIsWin() { | |
return machineIsWin; | |
} |
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 was 2 seconds away from pushing this change. :)
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.
Sorry, guess my review was sloppy. "Is the project better now?" If the answer is yes, then I try to get people's stuff merged-in ASAP - I try to err on the side of not blocking people once I'm confident that it's not making new bugs or vulnerabilities. It's not a big deal to have this duplicated. If you want to swap this out in some future PR then fine, if it stays duplicated that's fine too.
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.
Sure! I'll look into the this issue #710 and add it there.
Also, needs a changelog entry in |
Any idea what's going on with the npm one? Does it use a different java version? |
Spotless is JRE 8+ Lines 92 to 107 in 23f8d69
The Path method you are using is present in JRE 11, but not in JRE 8. |
- Unix regex for wrapped in `'`. `\\` is not needed anymore. - On Windows paths use backslashes, so `\\\\` has to be used. 2 for java strings and 2 since this parameter is treated as a regex.
90f1f1d
to
f841d27
Compare
Thanks for the fix! |
Thanks for your support! You make it really easy for people to contribute. |
(
,|
and)
should not be escaped with\
, otherwise they getinterpreted as literals and no file matches
\\\\
has to be used.2 for java strings and 2 since this parameter is treated as a regex.
Few remarks:
check
on Windows. Changes only on Tests..*/src/main/java/test\\(1\\|3\\).java
should have been interpreted as literal.