Skip to content
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

chore(deps): update plugin com.diffplug.spotless to v6.22.0 #2343

Merged
merged 8 commits into from
Sep 30, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 1 addition & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
gradlew linguist-generated=true
gradlew.bat linguist-generated=true

# Auto detect text files and perform LF normalization
* text=auto eol=lf

*.jar binary
*.png binary
*.xsl binary
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ Currently the versioning policy of this project follows [Semantic Versioning v2.
- Prefer log4j2 2.20.0 ([#2480](https://github.com/spotbugs/spotbugs/pull/2480))
- Prefer logback 1.4.8 ([#2480](https://github.com/spotbugs/spotbugs/pull/2480))
- Switch junit 4 for junit 5 vintage engine ([#2483](https://github.com/spotbugs/spotbugs/pull/2483))
- LineEndings and Spotless ([#2343](https://github.com/spotbugs/spotbugs/pull/2343))
- Cleanup gitattributes switching text to auto. For developers using windows, run 'git add . --renormalize' and see https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings if needed.
- Rework spotless setup from plugin to build file plugin matching that of gradle plugin and thus allowing spotless to be updated to 6.22.0
- Remove customized line endings for spotless so it uses git attributes as suggested by spotless
- Add trimTrailingWhitespace for spotless
- Fix deprecated usage of eclipse version from 4.13.0 to 4.13 per spotless requirements


## 4.7.3 - 2022-10-15
### Fixed
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "org.sonarqube" version "4.4.0.3356"
id "com.diffplug.spotless" version "6.14.0"
id "org.gradle.crypto.checksum" version "1.4.0"
id "com.github.spotbugs" version "5.1.3"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
plugins {
`kotlin-dsl`
id("com.diffplug.spotless") version "6.22.0"
}

repositories {
gradlePluginPortal()
}
dependencies {
implementation("com.diffplug.gradle:goomph:3.43.0")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.22.0")
}
4 changes: 2 additions & 2 deletions gradle/eclipse.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ eclipse {
buildCommand 'edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder'

// Link default settings to all eclipse projects, see #380
// Don't link settings to the test cases - they contain broken code (on purpose)
// Don't link settings to the test cases - they contain broken code (on purpose)
if(!testCasesProject){
linkedResource name: '.settings', type: '2', locationUri: '$%7BPARENT-1-PROJECT_LOC%7D/gradle/.settings-templates'
linkedResource name: '.settings', type: '2', locationUri: '$%7BPARENT-1-PROJECT_LOC%7D/gradle/.settings-templates'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ apply plugin: "com.diffplug.spotless"
spotless {
java {
removeUnusedImports()
eclipse("4.13.0").configFile "${rootProject.projectDir}/gradle/eclipse-formatter.xml"
trimTrailingWhitespace()
eclipse("4.13").configFile "${rootProject.projectDir}/gradle/eclipse-formatter.xml"
endWithNewline()
lineEndings 'UNIX'
}
}
4 changes: 2 additions & 2 deletions spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -2125,9 +2125,9 @@ private void addJavaAnnotationNames(BugAnnotation annotation) {
public BugInstance add(@Nonnull BugAnnotation annotation) {
requireNonNull(annotation, "Missing BugAnnotation!");

// The java annotations for the class were not stored before,
// The java annotations for the class were not stored before,
// thus we add a post-hook to lookup the java annotations for
// bug annotation types that have a class descriptor. Then
// bug annotation types that have a class descriptor. Then
// post-analysis matcher can easily filter based on the java
// annotations (without having to look at the bytecode again).
if (annotation instanceof PackageMemberAnnotation) {
Expand Down
10 changes: 5 additions & 5 deletions spotbugs/src/main/java/edu/umd/cs/findbugs/PluginLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ private static void finishLazyInitialization() {
/**
* Creates a new {@link URLClassLoader} and adds it to the list of classloaders
* we need to close if we close the corresponding plugin
*
* @param
*
* @param
* urls the URLs from which to load classes and resources
* @return a new {@link URLClassLoader}
*/
Expand All @@ -297,10 +297,10 @@ private URLClassLoader buildURLClassLoader(URL[] urls) {
/**
* Creates a new {@link URLClassLoader} and adds it to the list of classloaders
* we need to close if we close the corresponding plugin
*
* @param
*
* @param
* urls the URLs from which to load classes and resources
* @param
* @param
* parent the parent class loader for delegation
* @return a new {@link URLClassLoader}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/**
* An implementation of {@link BugReporter} that synchronize all method invocations.
*
*
* @since 4.0
*/
class SynchronizedBugReporter implements BugReporter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ private TypeQualifierValue(ClassDescriptor typeQualifier, @CheckForNull Object v
if (!SystemProperties.RUNNING_AS_IDE_PLUGIN) {
/* don't do this if running in Eclipse; check below is the quick
fix for bug 3599258 (Random obscure Eclipse failures during analysis)

Also don't do this if running in IntelliJ IDEA. This causes weird issues
either (see IDEA-230268)
either (see IDEA-230268)
*/

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public String toResourceName() {
* Get the name of the class in dotted format.
*
* @return the name of the class in dotted format
*
*
* @deprecated use {@link #getDottedClassName()} instead.
*/
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private int checkSeen(int seen) {
}

/**
* Finds MET01 rule violating assertions.
* Finds MET01 rule violating assertions.
*/
@Override
protected void detect(int seen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void visit(JavaClass obj) {
data.innerClassCannotBeStatic.add(getDottedSuperclassName());
}
if (getXClass().getAnnotation(junitNestedAnnotation) != null) {
// This class is a JUnit nested test, it can't be static
// This class is a JUnit nested test, it can't be static
data.innerClassCannotBeStatic.add(getDottedClassName());
}
// Does this class directly implement Serializable?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@

/**
* Utility methods for working with bootstrap methods
*
*
* @author ÁdÑm Balogh
*/
public class BootstrapMethodsUtil {

/**
* Returns the method representation of a bootstrap method from a Java class.
*
*
* @param bms
* the BootstrapMethods attribute of a java class
* @param index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public static boolean matchedPrefixes(String[] classSearchStrings, @DottedClassN
* edits (insertions, deletions or substitutions). This limit also speeds up the computation.
* <p>
* For more information on the Levenshtein distance see
* <a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Wikipedia</a> and the
* <a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Wikipedia</a> and the
* <a href="https://commons.apache.org/proper/commons-text/apidocs/org/apache/commons/text/similarity/LevenshteinDistance.html">Apache Commons Text JavaDoc</a>.
*
* @param className the full class name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* A class to execute integration test for SpotBugs. This is basically designed to help SpotBugs plugin developer to
* test their product.
* </p>
*
*
* @since 3.1
*/
public class SpotBugsRunner {
Expand Down