Skip to content

Commit 8e30175

Browse files
committed
Make IDEA tests special
As described here: diffplug#200 (comment)
1 parent effe2fc commit 8e30175

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

gradle/special-tests.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ def special = [
66
'Buf',
77
'Clang',
88
'gofmt',
9+
'idea',
910
'Npm',
1011
'Shfmt'
1112
]

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
import java.io.IOException;
1919

2020
import org.junit.jupiter.api.Test;
21+
import com.diffplug.spotless.tag.IdeaTest;
2122

22-
23+
@IdeaTest
2324
class JavaIdeaTest extends GradleIntegrationHarness {
2425
@Test
2526
void idea() throws IOException {

plugin-maven/src/test/java/com/diffplug/spotless/maven/java/IdeaTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import com.diffplug.spotless.maven.MavenIntegrationHarness;
2121

22+
@com.diffplug.spotless.tag.IdeaTest
2223
class IdeaTest extends MavenIntegrationHarness {
2324
@Test
2425
void idea() throws Exception {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2021-2024 DiffPlug
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.diffplug.spotless.tag;
17+
18+
import static java.lang.annotation.ElementType.METHOD;
19+
import static java.lang.annotation.ElementType.TYPE;
20+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
21+
22+
import java.lang.annotation.Retention;
23+
import java.lang.annotation.Target;
24+
25+
import org.junit.jupiter.api.Tag;
26+
27+
@Target({TYPE, METHOD})
28+
@Retention(RUNTIME)
29+
@Tag("idea")
30+
public @interface IdeaTest {}

testlib/src/test/java/com/diffplug/spotless/java/IdeaStepTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import com.diffplug.common.io.Files;
88
import com.diffplug.spotless.FormatterStep;
99
import com.diffplug.spotless.ResourceHarness;
10+
import com.diffplug.spotless.tag.IdeaTest;
1011

12+
@IdeaTest
1113
class IdeaStepTest extends ResourceHarness {
1214

1315
@Test

0 commit comments

Comments
 (0)