Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sanityCheck:
sanity-check:
name: SanityCheck
runs-on: ubuntu-latest
env:
buildcacheuser: ${{ secrets.BUILDCACHE_USER }}
Expand All @@ -35,7 +36,7 @@ jobs:
- name: assemble testClasses
run: ./gradlew assemble testClasses
build:
needs: sanityCheck
needs: sanity-check
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -107,7 +108,7 @@ jobs:
# Status check that is required in branch protection rules.
final-status:
needs:
- sanityCheck
- sanity-check
- build
runs-on: ubuntu-latest
if: always()
Expand Down
55 changes: 25 additions & 30 deletions gradle/error-prone.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,45 @@
apply plugin: 'net.ltgt.errorprone'
import static java.lang.System.getenv

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

tasks.withType(JavaCompile).configureEach {
options.errorprone {
disable( // consider fix, or reasoning.
disableAllWarnings = true // https://github.com/diffplug/spotless/issues/2745 https://github.com/google/error-prone/issues/5365
disable(
// consider fix, or reasoning.
'AnnotateFormatMethod', // We don`t want to use ErrorProne's annotations.
'DoNotCallSuggester', // We don`t want to use ErrorProne's annotations.
'FunctionalInterfaceMethodChanged',
'ImmutableEnumChecker', // We don`t want to use ErrorProne's annotations.
'InlineMeSuggester', // We don`t want to use ErrorProne's annotations.
'JavaxInjectOnAbstractMethod',
'OverridesJavaxInjectableMethod',
'ReturnValueIgnored', // We don`t want to use ErrorProne's annotations.
)
error(
'AmbiguousJsonCreator',
'AssertJNullnessAssertion',
'AutowiredConstructor',
'CanonicalAnnotationSyntax',
'CollectorMutability',
'ConstantNaming',
'DirectReturn',
'EmptyMethod',
'ExplicitArgumentEnumeration',
'ExplicitEnumOrdering',
'IdentityConversion',
'ImmutablesSortedSetComparator',
'IsInstanceLambdaUsage',
'MockitoMockClassReference',
'MockitoStubbing',
'NestedOptionals',
'PrimitiveComparison',
'RedundantStringConversion',
'RedundantStringEscape',
'ReturnValueIgnored',
'SelfAssignment',
'StringJoin',
'StringJoining',
'UnnecessarilyFullyQualified',
'UnnecessaryLambda',
)
// bug: this only happens when the file is dirty.
// might be an up2date (caching) issue, as file is currently in corrupt state.
// ForbidGradleInternal(import org.gradle.api.internal.project.ProjectInternal;)
errorproneArgs.add('-XepExcludedPaths:' +
'.*/SelfTest.java|' +
'.*/GradleIntegrationHarness.java'
// ForbidGradleInternal(import
excludedPaths.set(
'.*/GradleIntegrationHarness.java|'+
'.*/SelfTest.java'
)
if (!getenv().containsKey('CI') && getenv('IN_PLACE')?.toBoolean()) {
errorproneArgs.addAll(
'-XepPatchLocation:IN_PLACE',
'-XepPatchChecks:' +
'MissingOverride'
)
}
}
}

dependencies {
errorprone('com.google.errorprone:error_prone_core:2.42.0')
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,64 +98,84 @@ private static class Buffer implements IBuffer {
this.contents = contents;
}

@Override
public void addBufferChangedListener(IBufferChangedListener listener) {}

@Override
public void append(char[] text) {}

@Override
public void append(String text) {}

@Override
public void close() {}

@Override
public char getChar(int position) {
return '\u0000';
}

@Override
public char[] getCharacters() {
return contents.toCharArray();
}

@Override
public String getContents() {
return contents;
}

@Override
public int getLength() {
return 0;
}

@Override
public IOpenable getOwner() {
return null;
}

@Override
public String getText(int offset, int length) {
return null;
}

@Override
public IResource getUnderlyingResource() {
return null;
}

@Override
public boolean hasUnsavedChanges() {
return false;
}

@Override
public boolean isClosed() {
return false;
}

@Override
public boolean isReadOnly() {
return true;
}

@Override
public void removeBufferChangedListener(IBufferChangedListener listener) {}

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

@Override
public void replace(int position, int length, String text) {}

@Override
public void save(IProgressMonitor progress, boolean force) {}

@Override
public void setContents(char[] contents) {}

@Override
public void setContents(String contents) {
this.contents = contents;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023 DiffPlug
* Copyright 2021-2025 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,6 +43,7 @@ public JacksonYamlFormatterFunc(JacksonYamlConfig jacksonConfig) {
}
}

@Override
Copy link
Contributor Author

@Pankraz76 Pankraz76 Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also rewrite, not spotless, ending up being error prone as well completing the circulation.

protected JsonFactory makeJsonFactory() {
YAMLFactoryBuilder yamlFactoryBuilder = new YAMLFactoryBuilder(new YAMLFactory());

Expand Down
Loading