Skip to content

Commit 955c26a

Browse files
committed
spotlessApply
1 parent bc9f236 commit 955c26a

File tree

8 files changed

+31
-34
lines changed

8 files changed

+31
-34
lines changed

lib/src/main/java/com/diffplug/spotless/npm/PrettierConfig.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,17 +40,15 @@ public PrettierConfig(@Nullable File prettierConfigPath, @Nullable Map<String, O
4040
this.editorconfig = editorconfig;
4141
}
4242

43-
@Nullable
44-
public File getPrettierConfigPath() {
43+
@Nullable public File getPrettierConfigPath() {
4544
return prettierConfigPathSignature == null ? null : prettierConfigPathSignature.get().getOnlyFile();
4645
}
4746

4847
public Map<String, Object> getOptions() {
4948
return new TreeMap<>(this.options);
5049
}
5150

52-
@Nullable
53-
public Boolean getEditorconfig() {
51+
@Nullable public Boolean getEditorconfig() {
5452
return editorconfig;
5553
}
5654
}

lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

lib/src/main/java/com/diffplug/spotless/npm/PrettierRestService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,7 @@ public class PrettierConfig extends NpmStepConfig<PrettierConfig> {
769769

770770
@Nullable Map<String, Object> prettierConfig;
771771

772-
@Nullable
773-
Boolean editorconfig;
772+
@Nullable Boolean editorconfig;
774773

775774
final Map<String, String> devDependencies;
776775

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/PrettierIntegrationTest.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -121,26 +121,26 @@ void useEditorconfig(String prettierVersion) throws IOException {
121121
setFile(".prettierrc.yml").toResource("npm/prettier/config/.prettierrc_noop.yml");
122122
setFile(".editorconfig").toResource("npm/prettier/config/.editorconfig_20");
123123
setFile("build.gradle").toLines(
124-
"plugins {",
125-
" id 'com.diffplug.spotless'",
126-
"}",
127-
"repositories { mavenCentral() }",
128-
"spotless {",
129-
" format 'mytypescript', {",
130-
" target 'test.ts'",
131-
" prettier('" + prettierVersion + "').configFile('.prettierrc.yml').editorconfig(true)",
132-
" }",
133-
"}");
124+
"plugins {",
125+
" id 'com.diffplug.spotless'",
126+
"}",
127+
"repositories { mavenCentral() }",
128+
"spotless {",
129+
" format 'mytypescript', {",
130+
" target 'test.ts'",
131+
" prettier('" + prettierVersion + "').configFile('.prettierrc.yml').editorconfig(true)",
132+
" }",
133+
"}");
134134
setFile("test.ts").toResource("npm/prettier/config/typescript.dirty");
135135
final BuildResult spotlessApply = gradleRunner().withArguments("--stacktrace", "spotlessApply").build();
136136
Assertions.assertThat(spotlessApply.getOutput()).contains("BUILD SUCCESSFUL");
137137
switch (prettierVersion) {
138-
case PRETTIER_VERSION_2:
139-
assertFile("test.ts").sameAsResource("npm/prettier/config/typescript.configfile_prettier_2.clean");
140-
break;
141-
case PRETTIER_VERSION_3:
142-
assertFile("test.ts").sameAsResource("npm/prettier/config/typescript.configfile_prettier_3.clean");
143-
break;
138+
case PRETTIER_VERSION_2:
139+
assertFile("test.ts").sameAsResource("npm/prettier/config/typescript.configfile_prettier_2.clean");
140+
break;
141+
case PRETTIER_VERSION_3:
142+
assertFile("test.ts").sameAsResource("npm/prettier/config/typescript.configfile_prettier_3.clean");
143+
break;
144144
}
145145
}
146146

plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/Prettier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

plugin-maven/src/test/java/com/diffplug/spotless/maven/prettier/PrettierFormatStepTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -162,11 +162,11 @@ void multiple_prettier_configs() throws Exception {
162162
void prettier_editorconfig() throws Exception {
163163
String suffix = "ts";
164164
writePomWithPrettierSteps("**/*." + suffix,
165-
"<prettier>",
166-
" <prettierVersion>1.16.4</prettierVersion>",
167-
" <configFile>.prettierrc.yml</configFile>",
168-
" <editorconfig>true</editorconfig>",
169-
"</prettier>");
165+
"<prettier>",
166+
" <prettierVersion>1.16.4</prettierVersion>",
167+
" <configFile>.prettierrc.yml</configFile>",
168+
" <editorconfig>true</editorconfig>",
169+
"</prettier>");
170170

171171
String kind = "typescript";
172172
setFile(".prettierrc.yml").toResource("npm/prettier/config/.prettierrc_noop.yml");

testlib/src/test/java/com/diffplug/spotless/npm/PrettierFormatterStepTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)