Skip to content

chore: Support spotbugs running anywhere #1537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 14, 2023
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
2 changes: 2 additions & 0 deletions .mvn/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is here purely so that we can get the root directory using maven.multiModuleProjectDirectory

2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<module name="FileLength"/>

<module name="Header">
<property name="headerFile" value="license-header"/>
<property name="headerFile" value="${basedir}/license-header"/>
<property name="severity" value="error"/>
</module>

Expand Down
20 changes: 0 additions & 20 deletions examples/spotbugs-exclude.xml

This file was deleted.

7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
<aws-embedded-metrics.version>1.0.6</aws-embedded-metrics.version>
<jmespath.version>0.6.0</jmespath.version>
<elastic.version>1.5.0</elastic.version>

<!-- As we have a .mvn directory at the root of the project, this will evaluate to the root directory
regardless of where maven is run - sub-module, or root. -->
<project.rootdir>${maven.multiModuleProjectDirectory}</project.rootdir>
</properties>

<distributionManagement>
Expand Down Expand Up @@ -542,7 +546,7 @@
</executions>
<configuration>
<xmlOutput>true</xmlOutput>
<excludeFilterFile>../spotbugs-exclude.xml</excludeFilterFile>
<excludeFilterFile>${project.rootdir}/spotbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -639,6 +643,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<propertyExpansion>basedir=${project.rootdir}</propertyExpansion>
<configLocation>checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
Expand Down
30 changes: 0 additions & 30 deletions powertools-logging/spotbugs-exclude.xml

This file was deleted.

82 changes: 0 additions & 82 deletions powertools-parameters/spotbugs-exclude.xml

This file was deleted.

65 changes: 62 additions & 3 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,34 @@
<Class name="software.amazon.lambda.powertools.parameters.secrets.SecretsProviderBuilder"/>
<Field name="client"/>
</And>

<And>
<Class name="software.amazon.lambda.powertools.parameters.ssm.SSMProviderBuilder"/>
<Field name="client"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.parameters.ssm.SSMProviderBuilder"/>
<Field name="cacheManager"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.parameters.dynamodb.DynamoDbProviderBuilder"/>
<Field name="cacheManager"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.parameters.dynamodb.DynamoDbProviderBuilder"/>
<Field name="client"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.parameters.dynamodb.DynamoDbProviderBuilder"/>
<Field name="transformationManager"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.parameters.appconfig.AppConfigProviderBuilder"/>
<Field name="cacheManager"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.parameters.appconfig.AppConfigProviderBuilder"/>
<Field name="transformationManager"/>
</And>
</Or>
</Match>
<!-- Internals of Log event for apache log4j-->
Expand All @@ -58,6 +85,18 @@
<Class name="software.amazon.lambda.powertools.largemessages.LargeMessageConfig"/>
<Method name="getS3Client"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.internal.AbstractJacksonLayoutCopy$Builder" />
<Method name="getAdditionalFields"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.internal.AbstractJacksonLayoutCopy$LogEventWithAdditionalFields" />
<Method name="getAdditionalFields"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.internal.LambdaJsonLayout$LogEventWithAdditionalFields" />
<Method name="getAdditionalFields"/>
</And>
</Or>
</Match>
<Match>
Expand Down Expand Up @@ -103,6 +142,26 @@
<Class name="software.amazon.lambda.powertools.largemessages.LargeMessageConfig"/>
<Field name="s3Client"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.internal.AbstractJacksonLayoutCopy" />
<Method name="LogEventWithAdditionalFields"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.internal.AbstractJacksonLayoutCopy$Builder" />
<Method name="setAdditionalFields"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.internal.LambdaJsonLayout" />
<Method name="LogEventWithAdditionalFields"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.LambdaEcsEncoder" />
<Method name="setThrowableConverter"/>
</And>
<And>
<Class name="software.amazon.lambda.powertools.logging.LambdaJsonEncoder" />
<Method name="setThrowableConverter"/>
</And>
</Or>
</Match>
<!--Functionally needed-->
Expand Down Expand Up @@ -171,5 +230,5 @@
<Method name="threadOption1"/>
</And>
</Or>
</Match>
</FindBugsFilter>
</Match>
</FindBugsFilter>