Skip to content

Commit 93eb099

Browse files
authored
Merge branch 'main' into serializable-refactor
2 parents 4b15b39 + b3c4893 commit 93eb099

File tree

18 files changed

+106
-24
lines changed

18 files changed

+106
-24
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1414
* `FileSignature.Promised` and `JarState.Promised` to facilitate round-trip serialization for the Gradle configuration cache. ([#1945](https://github.com/diffplug/spotless/pull/1945))
1515
### Removed
1616
* **BREAKING** Remove `JarState.getMavenCoordinate(String prefix)`. ([#1945](https://github.com/diffplug/spotless/pull/1945))
17+
### Fixed
18+
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
1719

1820
## [2.45.0] - 2024-01-23
1921
### Added

gradle/special-tests.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ apply plugin: 'com.adarshr.test-logger'
22

33
// See com.diffplug.spotless.tag package for available JUnit 5 @Tag annotations
44
def special = [
5-
'Black',
6-
'Buf',
7-
'Clang',
5+
'black',
6+
'buf',
7+
'clang',
88
'gofmt',
9-
'Npm',
10-
'Shfmt'
9+
'npm',
10+
'shfmt'
1111
]
1212

1313
boolean isCiServer = System.getenv().containsKey("CI")
@@ -31,7 +31,7 @@ tasks.named('test').configure {
3131
}
3232
}
3333
special.forEach { tag ->
34-
tasks.register("test${tag}", Test) {
34+
tasks.register("test${tag.capitalize()}", Test) {
3535
useJUnitPlatform { includeTags tag }
3636
}
3737
}

lib-extra/src/test/java/com/diffplug/spotless/extra/GitAttributesTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 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.
@@ -27,9 +27,11 @@
2727
import org.junit.jupiter.api.Test;
2828

2929
import com.diffplug.common.base.StringPrinter;
30+
import com.diffplug.spotless.ClearGitConfig;
3031
import com.diffplug.spotless.LineEnding;
3132
import com.diffplug.spotless.ResourceHarness;
3233

34+
@ClearGitConfig
3335
class GitAttributesTest extends ResourceHarness {
3436
private List<File> testFiles(String prefix) {
3537
List<File> result = new ArrayList<>();

lib-extra/src/test/java/com/diffplug/spotless/extra/GitRachetMergeBaseTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 DiffPlug
2+
* Copyright 2020-2024 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.
@@ -27,8 +27,10 @@
2727
import org.eclipse.jgit.lib.RefDatabase;
2828
import org.junit.jupiter.api.Test;
2929

30+
import com.diffplug.spotless.ClearGitConfig;
3031
import com.diffplug.spotless.ResourceHarness;
3132

33+
@ClearGitConfig
3234
class GitRachetMergeBaseTest extends ResourceHarness {
3335
@Test
3436
void test() throws IllegalStateException, GitAPIException, IOException {

lib-extra/src/test/java/com/diffplug/spotless/extra/GitWorkaroundsTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 DiffPlug
2+
* Copyright 2022-2024 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.
@@ -27,9 +27,11 @@
2727
import org.junit.jupiter.api.Nested;
2828
import org.junit.jupiter.api.Test;
2929

30+
import com.diffplug.spotless.ClearGitConfig;
3031
import com.diffplug.spotless.ResourceHarness;
3132
import com.diffplug.spotless.extra.GitWorkarounds.RepositorySpecificResolver;
3233

34+
@ClearGitConfig
3335
class GitWorkaroundsTest extends ResourceHarness {
3436
@Test
3537
void inline() throws IOException, GitAPIException {

plugin-gradle/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
68

79
## [6.25.0] - 2024-01-23
810
### Added

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 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.
@@ -36,6 +36,9 @@
3636
import org.junit.jupiter.params.ParameterizedTest;
3737
import org.junit.jupiter.params.provider.ValueSource;
3838

39+
import com.diffplug.spotless.ClearGitConfig;
40+
41+
@ClearGitConfig
3942
class GitRatchetGradleTest extends GradleIntegrationHarness {
4043
private static final String TEST_PATH = "src/markdown/test.md";
4144

@@ -268,10 +271,9 @@ public BuildResultAssertion outcome(String taskPath, TaskOutcome expected) {
268271
private RevCommit addAndCommit(Git git) throws NoFilepatternException, GitAPIException {
269272
PersonIdent emptyPerson = new PersonIdent("jane doe", "[email protected]", new Date(0), TimeZone.getTimeZone("UTC"));
270273
git.add().addFilepattern(".").call();
271-
RevCommit commit = git.commit().setMessage("baseline")
274+
return git.commit().setMessage("baseline")
272275
.setCommitter(emptyPerson)
273276
.setAuthor(emptyPerson)
274277
.call();
275-
return commit;
276278
}
277279
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2024 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.
@@ -21,6 +21,9 @@
2121
import org.eclipse.jgit.api.Git;
2222
import org.junit.jupiter.api.Test;
2323

24+
import com.diffplug.spotless.ClearGitConfig;
25+
26+
@ClearGitConfig
2427
class LicenseHeaderTest extends GradleIntegrationHarness {
2528
private static final String NOW = String.valueOf(YearMonth.now().getYear());
2629

plugin-maven/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
68

79
## [2.43.0] - 2024-01-23
810
### Added

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 DiffPlug
2+
* Copyright 2020-2024 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.
@@ -25,7 +25,9 @@
2525
import org.junit.jupiter.api.Test;
2626

2727
import com.diffplug.common.base.StringPrinter;
28+
import com.diffplug.spotless.ClearGitConfig;
2829

30+
@ClearGitConfig
2931
class GitRatchetMavenTest extends MavenIntegrationHarness {
3032
private static final String TEST_PATH = "src/markdown/test.md";
3133

0 commit comments

Comments
 (0)