Skip to content

Commit 84d377e

Browse files
author
Vincent Potucek
committed
[prone] remove failing tech.picnic.error-prone-support
- #2745 Signed-off-by: Vincent Potucek <[email protected]>
1 parent e4edf85 commit 84d377e

File tree

4 files changed

+78
-34
lines changed

4 files changed

+78
-34
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
1414
jobs:
15-
sanityCheck:
15+
sanity-check:
16+
name: SanityCheck
1617
runs-on: ubuntu-latest
1718
env:
1819
buildcacheuser: ${{ secrets.BUILDCACHE_USER }}
@@ -35,7 +36,7 @@ jobs:
3536
- name: assemble testClasses
3637
run: ./gradlew assemble testClasses
3738
build:
38-
needs: sanityCheck
39+
needs: sanity-check
3940
strategy:
4041
fail-fast: false
4142
matrix:
@@ -107,7 +108,7 @@ jobs:
107108
# Status check that is required in branch protection rules.
108109
final-status:
109110
needs:
110-
- sanityCheck
111+
- sanity-check
111112
- build
112113
runs-on: ubuntu-latest
113114
if: always()

gradle/error-prone.gradle

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,72 @@
1-
apply plugin: 'net.ltgt.errorprone'
1+
import static java.lang.System.getenv
22

3-
dependencies {
4-
errorprone('com.google.errorprone:error_prone_core:2.42.0')
5-
errorprone('tech.picnic.error-prone-support:error-prone-contrib:0.26.0')
6-
}
3+
apply plugin: 'net.ltgt.errorprone'
74

85
tasks.withType(JavaCompile).configureEach {
96
options.errorprone {
10-
disable( // consider fix, or reasoning.
7+
disableAllWarnings = true // https://github.com/diffplug/spotless/issues/2745 https://github.com/google/error-prone/issues/5365
8+
disable(
9+
// consider fix, or reasoning.
10+
'AnnotateFormatMethod', // We don`t want to use ErrorProne's annotations.
11+
// 'CollectorMutability', // for freedom global exclude, might whitelist. https://github.com/diffplug/spotless/pull/2744#discussion_r2553042130
12+
'DoNotCallSuggester', // We don`t want to use ErrorProne's annotations.
1113
'FunctionalInterfaceMethodChanged',
14+
'ImmutableEnumChecker', // We don`t want to use ErrorProne's annotations.
15+
'InlineMeSuggester', // We don`t want to use ErrorProne's annotations.
1216
'JavaxInjectOnAbstractMethod',
1317
'OverridesJavaxInjectableMethod',
18+
'ReturnValueIgnored', // We don`t want to use ErrorProne's annotations.
19+
// bug
20+
'FieldMissingNullable',
21+
// 'Slf4jLogStatement',
22+
// 'Slf4jLoggerDeclaration',
23+
'Var'
1424
)
1525
error(
16-
'AmbiguousJsonCreator',
17-
'AssertJNullnessAssertion',
18-
'AutowiredConstructor',
19-
'CanonicalAnnotationSyntax',
20-
'CollectorMutability',
21-
'ConstantNaming',
22-
'DirectReturn',
23-
'EmptyMethod',
24-
'ExplicitArgumentEnumeration',
25-
'ExplicitEnumOrdering',
26-
'IdentityConversion',
27-
'ImmutablesSortedSetComparator',
28-
'IsInstanceLambdaUsage',
29-
'MockitoMockClassReference',
30-
'MockitoStubbing',
31-
'NestedOptionals',
32-
'PrimitiveComparison',
33-
'RedundantStringConversion',
34-
'RedundantStringEscape',
26+
// 'AmbiguousJsonCreator',
27+
// 'AssertJNullnessAssertion',
28+
// 'AutowiredConstructor',
29+
// 'CanonicalAnnotationSyntax',
30+
// 'CollectorMutability',
31+
// 'ConstantNaming',
32+
// 'DirectReturn',
33+
// 'EmptyMethod',
34+
// 'ExplicitArgumentEnumeration',
35+
// 'ExplicitEnumOrdering',
36+
// 'IdentityConversion',
37+
// 'ImmutablesSortedSetComparator',
38+
// 'IsInstanceLambdaUsage',
39+
// 'MissingOverride',
40+
// 'MockitoMockClassReference',
41+
// 'MockitoStubbing',
42+
// 'NestedOptionals',
43+
// 'PrimitiveComparison',
44+
// 'RedundantStringConversion',
45+
// 'RedundantStringEscape',
3546
'ReturnValueIgnored',
3647
'SelfAssignment',
3748
'StringJoin',
38-
'StringJoining',
3949
'UnnecessarilyFullyQualified',
4050
'UnnecessaryLambda',
4151
)
4252
// bug: this only happens when the file is dirty.
4353
// might be an up2date (caching) issue, as file is currently in corrupt state.
44-
// ForbidGradleInternal(import org.gradle.api.internal.project.ProjectInternal;)
45-
errorproneArgs.add('-XepExcludedPaths:' +
46-
'.*/SelfTest.java|' +
47-
'.*/GradleIntegrationHarness.java'
54+
// ForbidGradleInternal(import
55+
excludedPaths.set(
56+
'.*/GradleIntegrationHarness.java|'+
57+
'.*/SelfTest.java'
4858
)
59+
if (!getenv().containsKey('CI') && getenv('IN_PLACE')?.toBoolean()) {
60+
errorproneArgs.addAll(
61+
'-XepPatchLocation:IN_PLACE', // how to prevent/ignore? @CanIgnoreReturnValue
62+
'-XepPatchChecks:' +
63+
'MissingOverride'
64+
)
65+
}
4966
}
5067
}
68+
69+
dependencies {
70+
errorprone('com.google.errorprone:error_prone_core:2.42.0')
71+
// errorprone('tech.picnic.error-prone-support:error-prone-contrib:0.26.0')
72+
}

lib-extra/src/jdt/java/com/diffplug/spotless/extra/glue/jdt/EclipseJdtSortMembers.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,64 +98,84 @@ private static class Buffer implements IBuffer {
9898
this.contents = contents;
9999
}
100100

101+
@Override
101102
public void addBufferChangedListener(IBufferChangedListener listener) {}
102103

104+
@Override
103105
public void append(char[] text) {}
104106

107+
@Override
105108
public void append(String text) {}
106109

110+
@Override
107111
public void close() {}
108112

113+
@Override
109114
public char getChar(int position) {
110115
return '\u0000';
111116
}
112117

118+
@Override
113119
public char[] getCharacters() {
114120
return contents.toCharArray();
115121
}
116122

123+
@Override
117124
public String getContents() {
118125
return contents;
119126
}
120127

128+
@Override
121129
public int getLength() {
122130
return 0;
123131
}
124132

133+
@Override
125134
public IOpenable getOwner() {
126135
return null;
127136
}
128137

138+
@Override
129139
public String getText(int offset, int length) {
130140
return null;
131141
}
132142

143+
@Override
133144
public IResource getUnderlyingResource() {
134145
return null;
135146
}
136147

148+
@Override
137149
public boolean hasUnsavedChanges() {
138150
return false;
139151
}
140152

153+
@Override
141154
public boolean isClosed() {
142155
return false;
143156
}
144157

158+
@Override
145159
public boolean isReadOnly() {
146160
return true;
147161
}
148162

163+
@Override
149164
public void removeBufferChangedListener(IBufferChangedListener listener) {}
150165

166+
@Override
151167
public void replace(int position, int length, char[] text) {}
152168

169+
@Override
153170
public void replace(int position, int length, String text) {}
154171

172+
@Override
155173
public void save(IProgressMonitor progress, boolean force) {}
156174

175+
@Override
157176
public void setContents(char[] contents) {}
158177

178+
@Override
159179
public void setContents(String contents) {
160180
this.contents = contents;
161181
}

lib/src/jackson/java/com/diffplug/spotless/glue/yaml/JacksonYamlFormatterFunc.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021-2023 DiffPlug
2+
* Copyright 2021-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.
@@ -43,6 +43,7 @@ public JacksonYamlFormatterFunc(JacksonYamlConfig jacksonConfig) {
4343
}
4444
}
4545

46+
@Override
4647
protected JsonFactory makeJsonFactory() {
4748
YAMLFactoryBuilder yamlFactoryBuilder = new YAMLFactoryBuilder(new YAMLFactory());
4849

0 commit comments

Comments
 (0)