Skip to content

Commit

Permalink
Excavator: Upgrades Baseline to the latest version (#201)
Browse files Browse the repository at this point in the history
* Excavator: Upgrades Baseline to the latest version

* Ensure root project name is set

* More progress

* Fix immutables

* Remove dropwizard 0.x stuff

* errorProneApply

* spotless

* errorprone for tests too

* Add generated changelog entries

* Create baseline-class-uniqueness.lock

* Remove unnecessary baseline applications

* Update baseline config

* checkstyle

* Check unused constraints

Co-authored-by: Callum Rogers <[email protected]>
  • Loading branch information
svc-excavator-bot and CRogers authored Apr 16, 2021
1 parent c7b97ad commit 59955f8
Show file tree
Hide file tree
Showing 37 changed files with 297 additions and 1,140 deletions.
14 changes: 8 additions & 6 deletions .baseline/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">

<!-- IMPORTANT ECLIPSE NOTE: If you change this file, you must restart Eclipse
for your changes to take effect in its Checkstyle integration. -->
Expand All @@ -12,6 +11,11 @@
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VariableDeclarationUsageDistance" />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VisibilityModifier" />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="AvoidStaticImport" />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemOut" />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemErr" />

<!-- Suppress test resources -->
<suppress files="[/\\]src[/\\]test[/\\]resources.*" checks="." />

<!-- JavadocStyle enforces existence of package-info.java package-level Javadoc; we consider this a bug. -->
<suppress files="package-info.java" checks="JavadocStyle" />
Expand All @@ -21,7 +25,5 @@
<suppress files="\.(bdr|eot|gif|gzip|jar|json|otf|png|svg|ttf|woff|zip)$" checks="NewlineAtEndOfFile" />

<!-- Generated code should not be subjected to checkstyle. -->
<suppress files="[/\\].*[/\\]generated_src[/\\]" checks="." />
<suppress files="[/\\].*[/\\]generated_testSrc[/\\]" checks="." />
<suppress files="[/\\].*[/\\]generated[/\\]" checks="." />
<suppress files="[/\\].*[/\\]generated.*[/\\]" checks="." />
</suppressions>
133 changes: 83 additions & 50 deletions .baseline/checkstyle/checkstyle.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .baseline/copyright/999_palantir.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(c) Copyright ${today.year} Palantir Technologies Inc. All rights reserved.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=;
org.eclipse.jdt.ui.javadoc=false
org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.ondemandthreshold=99
org.eclipse.jdt.ui.ondemandthreshold=999
org.eclipse.jdt.ui.overrideannotation=true
org.eclipse.jdt.ui.staticondemandthreshold=99
org.eclipse.jdt.ui.staticondemandthreshold=999
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment"/><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\n * (c) Copyright ${year} Palantir Technologies Inc. All rights reserved.\n */\n\n${package_declaration}\n\n/**\n * \n */\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">throw new RuntimeException(${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
Expand Down
46 changes: 37 additions & 9 deletions .baseline/idea/intellij-java-palantir-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
Expand All @@ -30,9 +30,10 @@
<package name="" static="false" withSubpackages="true" />
</value>
</option>
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<GroovyCodeStyleSettings>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
Expand All @@ -43,18 +44,32 @@
<package name="" withSubpackages="true" static="false" />
</value>
</option>
<DO_NOT_IMPORT_INNER>
<CLASS name="Builder" />
<CLASS name="Callback" />
<CLASS name="Class" />
<CLASS name="Entry" />
<CLASS name="Enum" />
<CLASS name="Factory" />
<CLASS name="Type" />
<CLASS name="Key" />
<CLASS name="Id" />
<CLASS name="Provider" />
</DO_NOT_IMPORT_INNER>
</GroovyCodeStyleSettings>
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
<option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
<option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
<option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
<option name="JD_KEEP_EMPTY_RETURN" value="false" />
<option name="JD_PRESERVE_LINE_FEEDS" value="true" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
Expand All @@ -66,7 +81,7 @@
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</value>
</option>
</option>
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
Expand All @@ -84,31 +99,44 @@
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_RESOURCES" value="false" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="ENUM_CONSTANTS_WRAP" value="2" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="1" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
<option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="LINE_COMMENT_ADD_SPACE" value="true" />
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<option name="RESOURCE_LIST_WRAP" value="5" />
<option name="RIGHT_MARGIN" value="120" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="WRAP_ON_TYPING" value="1" />
<arrangement>
<rules>
<section>
Expand Down
Empty file removed CHANGELOG
Empty file.
43 changes: 4 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ buildscript {

dependencies {
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.0.1'
classpath 'com.netflix.nebula:nebula-dependency-recommender:6.0.0'
classpath 'com.palantir.configurationresolver:gradle-configuration-resolver-plugin:0.3.0'
classpath 'com.palantir.gradle.docker:gradle-docker:0.12.0'
classpath 'com.palantir.baseline:gradle-baseline-java:0.20.1'
classpath 'com.palantir.baseline:gradle-baseline-java:3.76.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.28.0'
}
}

Expand All @@ -26,40 +25,18 @@ repositories {
jcenter()
}

apply plugin: 'com.palantir.baseline'
apply plugin: 'com.palantir.consistent-versions'
apply plugin: 'com.palantir.external-publish'
apply plugin: 'com.palantir.baseline-config'
apply plugin: 'com.palantir.baseline-idea'
apply plugin: 'org.inferred.processors'

dependencies {
baseline 'com.palantir.baseline:gradle-baseline-java-config:0.20.1@zip'
}

allprojects {
apply plugin: 'nebula.dependency-recommender'
apply plugin: 'com.palantir.configuration-resolver'

version gitVersion()
group 'com.palantir.config.crypto'

dependencyRecommendations {
strategy OverrideTransitives
propertiesFile file: project.rootProject.file('version.props')
}

configurations.all {
resolutionStrategy {
failOnVersionConflict()
}
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'com.palantir.baseline-checkstyle'
apply plugin: 'com.palantir.baseline-eclipse'
apply plugin: 'com.palantir.baseline-error-prone'
apply plugin: 'com.palantir.baseline-idea'
apply plugin: 'org.inferred.processors'
apply plugin: 'maven-publish'

Expand All @@ -69,19 +46,7 @@ subprojects {
jcenter()
}

javadoc {
classpath = sourceSets.main.compileClasspath + configurations.processor
}

sourceCompatibility = 1.8

tasks.check.dependsOn(javadoc)

compileJava {
options.compilerArgs += [
'-XepDisableWarningsInGeneratedCode',
'-Xep:OptionalEquality:WARN',
'-Werror'
]
}
}
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-201.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: break
break:
description: The `encrypted-config-value-bundle` supporting the ancient Dropwizard 0.x is removed.
links:
- https://github.com/palantir/encrypted-config-value/pull/201
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Danger! Multiple jars contain identically named classes. This may cause different behaviour depending on classpath ordering.
# Run ./gradlew checkClassUniqueness --write-locks to update this file

## runtimeClasspath
[javax.inject:javax.inject, org.glassfish.hk2.external:javax.inject]
- javax.inject.Inject
- javax.inject.Named
- javax.inject.Provider
- javax.inject.Qualifier
- javax.inject.Scope
- javax.inject.Singleton
12 changes: 2 additions & 10 deletions encrypted-config-value-bundle-dropwizard1/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
apply plugin: 'com.palantir.external-publish-jar'
apply from: "${rootDir}/gradle/immutables-processors.gradle"

dependencyRecommendations {
strategy OverrideTransitives
map recommendations: [
'com.fasterxml.jackson.core:*': '2.7.6',
'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml': '2.7.6'
]
}

dependencies {
compile project(':encrypted-config-value-module')
compile 'com.google.guava:guava'
compile 'com.fasterxml.jackson.core:jackson-databind'
compile 'io.dropwizard:dropwizard-core:1.0.0'
compile 'io.dropwizard:dropwizard-core'

testCompile 'org.hamcrest:hamcrest-all'
testCompile 'junit:junit'
testCompile 'io.dropwizard:dropwizard-testing:1.0.0'
testCompile 'io.dropwizard:dropwizard-testing'
}

tasks.check.dependsOn(javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,29 @@ public final class EncryptConfigValueCommand extends Command {
public static final String KEYFILE = "keyfile";
public static final String VALUE = "value";

protected EncryptConfigValueCommand() {
EncryptConfigValueCommand() {
super("encrypt-config-value", "Encrypts a configuration value so it can be stored securely");
}

@Override
public void configure(Subparser subparser) {
subparser.addArgument("-k", "--keyfile")
.required(false)
.type(String.class)
.dest(KEYFILE)
.setDefault(KeyFileUtils.DEFAULT_PUBLIC_KEY_PATH)
.help("The location of the (public) key file");
.required(false)
.type(String.class)
.dest(KEYFILE)
.setDefault(KeyFileUtils.DEFAULT_PUBLIC_KEY_PATH)
.help("The location of the (public) key file");

subparser.addArgument("-v", "--value")
.required(true)
.type(String.class)
.dest(VALUE)
.help("The value to encrypt");
.required(true)
.type(String.class)
.dest(VALUE)
.help("The value to encrypt");
}

@Override
public void run(Bootstrap<?> bootstrap, Namespace namespace) throws Exception {
@SuppressWarnings("BanSystemOut")
public void run(Bootstrap<?> _bootstrap, Namespace namespace) throws Exception {
String keyfile = namespace.getString(KEYFILE);
String value = namespace.getString(VALUE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public void initialize(Bootstrap<?> bootstrap) {
}

@Override
public void run(Environment environment) {}
public void run(Environment _environment) {}

}
Loading

0 comments on commit 59955f8

Please sign in to comment.