Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
sebersole committed Sep 23, 2024
1 parent c946009 commit 98e9a1f
Show file tree
Hide file tree
Showing 268 changed files with 112 additions and 655 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "io.github.gradle-nexus.publish-plugin"
id "release-process"
id 'com.diffplug.spotless' version '6.25.0' apply false
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
22 changes: 22 additions & 0 deletions buildSrc/src/main/groovy/java-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ plugins {
id "base-information"
id "java-library"

id "com.diffplug.spotless"
id "checkstyle"

id "jacoco"
}

Expand Down Expand Up @@ -50,6 +52,9 @@ tasks.withType( JavaCompile ).configureEach {javaCompile->
options.warnings false
}

tasks.named( "checkstyleMain" ) {
dependsOn( tasks.named( "spotlessJavaApply" ) )
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Javadoc
Expand All @@ -72,6 +77,23 @@ tasks.named( "javadoc", Javadoc ) {
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Spotless
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

spotless {
//Don't fail during the check: rather than enforcing guidelines, we use this plugin to fix mistakes automatically.
enforceCheck false
java {
licenseHeaderFile rootProject.file( 'config/spotless/license.java' )
removeUnusedImports()
indentWithTabs( 4 )
trimTrailingWhitespace()
endWithNewline()
}
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Checkstyle
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
29 changes: 0 additions & 29 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,20 @@
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">

<module name="Header">
<property name="headerFile" value="${config_loc}/headers/header-java.txt"/>
<property name="fileExtensions" value="java,gradle,groovy"/>
</module>

<module name="Header">
<property name="headerFile" value="${config_loc}/headers/header-xml.txt"/>
<property name="fileExtensions" value="xml,xsd,xjb"/>
</module>

<module name="TreeWalker">
<module name="RegexpSinglelineJava">
<property name="ignoreComments" value="true" />
<property name="format" value="^\t* +\t*\S" />
<property name="message" value="Line has leading space characters; indentation should be performed with tabs only." />
</module>

<module name="Regexp">
<property name="format" value="/^(master|slave)$/"/>
<property name="illegalPattern" value="true"/>
<property name="message" value="Conscious Language (use of terms 'master' or 'slave' not allowed)"/>
</module>

<module name="MissingDeprecated" />

<module name="MissingOverride" />

<module name="PackageAnnotation" />

<module name="NeedBraces" />

<module name="LeftCurly">
<property name="option" value="eol" />
</module>

<module name="RightCurly">
<property name="option" value="alone" />
</module>

<module name="EqualsHashCode" />

<module name="StringLiteralEquality" />

<module name="NoFinalizer" />

<module name="OneStatementPerLine" />
Expand Down
4 changes: 4 additions & 0 deletions config/spotless/license.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import java.lang.annotation.Annotation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import java.lang.annotation.Annotation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import org.hibernate.models.spi.ClassDetails;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import org.hibernate.models.UnknownClassException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import java.lang.reflect.InvocationTargetException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import org.hibernate.models.jandex.spi.JandexTypeSwitch;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/

package org.hibernate.models.jandex.internal;

import java.lang.annotation.Annotation;
Expand Down
Loading

0 comments on commit 98e9a1f

Please sign in to comment.