Skip to content

Commit

Permalink
Make IDEA tests special
Browse files Browse the repository at this point in the history
As described here:
diffplug#200 (comment)
  • Loading branch information
IlyasYOY committed Jan 23, 2024
1 parent effe2fc commit 8e30175
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions gradle/special-tests.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def special = [
'Buf',
'Clang',
'gofmt',
'idea',
'Npm',
'Shfmt'
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
import java.io.IOException;

import org.junit.jupiter.api.Test;
import com.diffplug.spotless.tag.IdeaTest;


@IdeaTest
class JavaIdeaTest extends GradleIntegrationHarness {
@Test
void idea() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import com.diffplug.spotless.maven.MavenIntegrationHarness;

@com.diffplug.spotless.tag.IdeaTest
class IdeaTest extends MavenIntegrationHarness {
@Test
void idea() throws Exception {
Expand Down
30 changes: 30 additions & 0 deletions testlib/src/main/java/com/diffplug/spotless/tag/IdeaTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2021-2024 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.diffplug.spotless.tag;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.junit.jupiter.api.Tag;

@Target({TYPE, METHOD})
@Retention(RUNTIME)
@Tag("idea")
public @interface IdeaTest {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import com.diffplug.common.io.Files;
import com.diffplug.spotless.FormatterStep;
import com.diffplug.spotless.ResourceHarness;
import com.diffplug.spotless.tag.IdeaTest;

@IdeaTest
class IdeaStepTest extends ResourceHarness {

@Test
Expand Down

0 comments on commit 8e30175

Please sign in to comment.