Skip to content

Commit 60f2bcd

Browse files
committed
Merge branch 'master' into feature/typescript-formatting-using-nodejs-in-j2v8
# Conflicts: # plugin-gradle/README.md # plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessExtension.java
2 parents 807bf7b + 8818804 commit 60f2bcd

File tree

64 files changed

+1952
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1952
-1003
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ You might be looking for:
77

88
### Version 1.15.0-SNAPSHOT - TBD (javadoc [lib](https://diffplug.github.io/spotless/javadoc/spotless-lib/snapshot/) [lib-extra](https://diffplug.github.io/spotless/javadoc/spotless-lib-extra/snapshot/), [snapshot repo](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/spotless/))
99

10+
* Added C/C++ support ([#232](https://github.com/diffplug/spotless/issues/232)).
11+
* Integrated Eclipse CDT formatter ([#274](https://github.com/diffplug/spotless/pull/274))
12+
* Extended dependency provisioner to exclude transitives on request ([#297](https://github.com/diffplug/spotless/pull/297)).This prevents unnecessary downloads of unused transitive dependencies for Eclipse based formatter steps.
1013
* Updated default groovy-eclipse from 4.8.0 to 4.8.1 ([#288](https://github.com/diffplug/spotless/pull/288)). New version is based on [Groovy-Eclipse 3.0.0](https://github.com/groovy/groovy-eclipse/wiki/3.0.0-Release-Notes).
1114
* Integrated Eclipse WTP formatter ([#290](https://github.com/diffplug/spotless/pull/290))
1215
* Updated JSR305 annotation from 3.0.0 to 3.0.2 ([#274](https://github.com/diffplug/spotless/pull/274))

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ lib('generic.LicenseHeaderStep') +'{{yes}} | {{yes}}
3838
lib('generic.ReplaceRegexStep') +'{{yes}} | {{yes}} | {{no}} |',
3939
lib('generic.ReplaceStep') +'{{yes}} | {{yes}} | {{no}} |',
4040
lib('generic.TrimTrailingWhitespaceStep') +'{{yes}} | {{yes}} | {{no}} |',
41+
extra('cpp.EclipseFormatterStep') +'{{yes}} | {{yes}} | {{no}} |',
4142
extra('groovy.GrEclipseFormatterStep') +'{{yes}} | {{no}} | {{no}} |',
4243
lib('java.GoogleJavaFormatStep') +'{{yes}} | {{yes}} | {{no}} |',
4344
lib('java.ImportOrderStep') +'{{yes}} | {{yes}} | {{no}} |',
@@ -49,6 +50,7 @@ lib('npm.PrettierFormatterStep') +'{{yes}} | {{no}}
4950
lib('npm.TsFmtFormatterStep') +'{{yes}} | {{no}} | {{no}} |',
5051
lib('scala.ScalaFmtStep') +'{{yes}} | {{yes}} | {{no}} |',
5152
lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{no}} | {{no}} |',
53+
extra('wtp.WtpEclipseFormatterStep') +'{{yes}} | {{yes}} | {{no}} |',
5254
'| [(Your FormatterStep here)](CONTRIBUTING.md#how-to-add-a-new-formatterstep) | {{no}} | {{no}} | {{no}} |',
5355
'| Fast up-to-date checking | {{yes}} | {{no}} | {{no}} |',
5456
'| Automatic idempotency safeguard | {{yes}} | {{no}} | {{no}} |',
@@ -63,6 +65,7 @@ lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{no}}
6365
| [`generic.ReplaceRegexStep`](lib/src/main/java/com/diffplug/spotless/generic/ReplaceRegexStep.java) | :+1: | :+1: | :white_large_square: |
6466
| [`generic.ReplaceStep`](lib/src/main/java/com/diffplug/spotless/generic/ReplaceStep.java) | :+1: | :+1: | :white_large_square: |
6567
| [`generic.TrimTrailingWhitespaceStep`](lib/src/main/java/com/diffplug/spotless/generic/TrimTrailingWhitespaceStep.java) | :+1: | :+1: | :white_large_square: |
68+
| [`cpp.EclipseFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/cpp/EclipseFormatterStep.java) | :+1: | :+1: | :white_large_square: |
6669
| [`groovy.GrEclipseFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/groovy/GrEclipseFormatterStep.java) | :+1: | :white_large_square: | :white_large_square: |
6770
| [`java.GoogleJavaFormatStep`](lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java) | :+1: | :+1: | :white_large_square: |
6871
| [`java.ImportOrderStep`](lib/src/main/java/com/diffplug/spotless/java/ImportOrderStep.java) | :+1: | :+1: | :white_large_square: |
@@ -74,6 +77,7 @@ lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{no}}
7477
| [`npm.TsFmtFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java) | :+1: | :white_large_square: | :white_large_square: |
7578
| [`scala.ScalaFmtStep`](lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java) | :+1: | :+1: | :white_large_square: |
7679
| [`sql.DBeaverSQLFormatterStep`](lib/src/main/java/com/diffplug/spotless/sql/DBeaverSQLFormatterStep.java) | :+1: | :white_large_square: | :white_large_square: |
80+
| [`wtp.WtpEclipseFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/wtp/WtpEclipseFormatterStep.java) | :+1: | :+1: | :white_large_square: |
7781
| [(Your FormatterStep here)](CONTRIBUTING.md#how-to-add-a-new-formatterstep) | :white_large_square: | :white_large_square: | :white_large_square: |
7882
| Fast up-to-date checking | :+1: | :white_large_square: | :white_large_square: |
7983
| Automatic idempotency safeguard | :+1: | :white_large_square: | :white_large_square: |

_ext/eclipse-wtp/src/test/java/com/diffplug/spotless/extra/eclipse/wtp/EclipseXmlFormatterStepImplTest.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,88 +41,88 @@ public static void initializeStatic() throws Exception {
4141

4242
@Test
4343
public void simpleDefaultFormat() throws Throwable {
44-
String output = format(TEST_DATA.input("xml_space.xml"), config -> {});
44+
String output = format(TEST_DATA.input("xml_space.test"), config -> {});
4545
assertEquals("Unexpected formatting with default preferences.",
46-
TEST_DATA.expected("xml_space.xml"), output);
46+
TEST_DATA.expected("xml_space.test"), output);
4747
}
4848

4949
@Test
5050
public void invalidXmlFormat() throws Throwable {
51-
String[] input = TEST_DATA.input("xml_space.xml");
51+
String[] input = TEST_DATA.input("xml_space.test");
5252
input[0] += INCOMPLETE;
5353
String output = format(input, config -> {});
54-
String expected = TEST_DATA.expected("xml_space.xml") + LINE_DELIMITER + INCOMPLETE;
54+
String expected = TEST_DATA.expected("xml_space.test") + LINE_DELIMITER + INCOMPLETE;
5555
assertEquals("Incomplete XML not formatted on best effort basis.",
5656
expected, output);
5757
}
5858

5959
@Test
6060
public void illegalXmlCharater() throws Throwable {
61-
String[] input = TEST_DATA.input("xml_space.xml");
61+
String[] input = TEST_DATA.input("xml_space.test");
6262
input[0] = ILLEGAL_CHAR + input[0];
6363
String output = format(input, config -> {});
64-
String expected = LINE_DELIMITER + LINE_DELIMITER + TEST_DATA.expected("xml_space.xml");
64+
String expected = LINE_DELIMITER + LINE_DELIMITER + TEST_DATA.expected("xml_space.test");
6565
assertEquals("Illegal character not replaced by line delimiter.", expected, output);
6666
}
6767

6868
@Test
6969
public void multipleConfigurations() throws Throwable {
70-
String output = format(TEST_DATA.input("xml_space.xml"), config -> {
70+
String output = format(TEST_DATA.input("xml_space.test"), config -> {
7171
config.setProperty(INDENTATION_SIZE, "2");
7272
config.setProperty(INDENTATION_CHAR, SPACE);
7373
});
74-
String expected = TEST_DATA.expected("xml_space.xml").replace("\t", " ");
74+
String expected = TEST_DATA.expected("xml_space.test").replace("\t", " ");
7575
assertEquals("Custom indentation configuration not applied.", expected, output);
7676

77-
output = format(TEST_DATA.input("xml_space.xml"), config -> {
77+
output = format(TEST_DATA.input("xml_space.test"), config -> {
7878
config.setProperty(SPLIT_MULTI_ATTRS, Boolean.toString(true));
7979
});
80-
expected = TEST_DATA.expected("xml_space.xml");
80+
expected = TEST_DATA.expected("xml_space.test");
8181
expected = expected.replace(" a=", LINE_DELIMITER + "\ta=");
8282
expected = expected.replace(" b=", LINE_DELIMITER + "\tb=");
8383
assertEquals("Custom indentation configuration not reverted or custom multiple argument configuration not applied.", expected, output);
8484
}
8585

8686
@Test
8787
public void invalidConfiguration() throws Throwable {
88-
String output = format(TEST_DATA.input("xml_space.xml"), config -> {
88+
String output = format(TEST_DATA.input("xml_space.test"), config -> {
8989
config.setProperty(INDENTATION_SIZE, "Not an integer");
9090
config.setProperty(INDENTATION_CHAR, SPACE);
9191
});
9292
assertEquals("Invalid indentation configuration not replaced by default value (0 spaces)",
93-
TEST_DATA.expected("xml_space.xml").replace("\t", ""), output);
93+
TEST_DATA.expected("xml_space.test").replace("\t", ""), output);
9494
}
9595

9696
@Test
9797
public void dtdRelativePath() throws Throwable {
98-
String output = format(TEST_DATA.input("dtd_relative.xml"), config -> {});
98+
String output = format(TEST_DATA.input("dtd_relative.test"), config -> {});
9999
assertEquals("Relative DTD not resolved. Restrictions are not applied by formatter.",
100-
TEST_DATA.expected("dtd_relative.xml"), output);
100+
TEST_DATA.expected("dtd_relative.test"), output);
101101
}
102102

103103
@Test
104104
public void xsdRelativePath() throws Throwable {
105-
String output = format(TEST_DATA.input("xsd_relative.xml"), config -> {});
105+
String output = format(TEST_DATA.input("xsd_relative.test"), config -> {});
106106
assertEquals("Relative XSD not resolved. Restrictions are not applied by formatter.",
107-
TEST_DATA.expected("xsd_relative.xml"), output);
107+
TEST_DATA.expected("xsd_relative.test"), output);
108108
}
109109

110110
@Test
111111
public void xsdNotFound() throws Throwable {
112-
String output = format(TEST_DATA.input("xsd_not_found.xml"), config -> {});
112+
String output = format(TEST_DATA.input("xsd_not_found.test"), config -> {});
113113
assertEquals("Unresolved XSD/DTD not silently ignored.",
114-
TEST_DATA.expected("xsd_not_found.xml"), output);
114+
TEST_DATA.expected("xsd_not_found.test"), output);
115115
}
116116

117117
@Test
118118
public void catalogLookup() throws Throwable {
119-
String output = format(TEST_DATA.input("xsd_not_found.xml"), config -> {
119+
String output = format(TEST_DATA.input("xsd_not_found.test"), config -> {
120120
config.setProperty(
121121
SpotlessPreferences.USER_CATALOG,
122122
TEST_DATA.getRestrictionsPath("catalog.xml").toString());
123123
});
124124
assertEquals("XSD not resolved by catalog. Restrictions are not applied by formatter.",
125-
TEST_DATA.expected("xsd_not_found.xml").replace(" remove spaces ", "remove spaces"), output);
125+
TEST_DATA.expected("xsd_not_found.test").replace(" remove spaces ", "remove spaces"), output);
126126
}
127127

128128
private static String format(final String[] input, final Consumer<Properties> config) throws Exception {

0 commit comments

Comments
 (0)