Skip to content

Commit

Permalink
Spotless (#300)
Browse files Browse the repository at this point in the history
* add spotless

* apply spotless

* update license check, fix license in evalTest
  • Loading branch information
kortemik authored Sep 2, 2024
1 parent a844b57 commit 21d96c9
Show file tree
Hide file tree
Showing 341 changed files with 18,092 additions and 14,513 deletions.
450 changes: 450 additions & 0 deletions eclipse-java-formatter.xml

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions license-header
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Teragrep Data Processing Language (DPL) translator for Apache Spark (pth_10)
* Copyright (C) 2019-2024 Suomen Kanuuna Oy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*
* Additional permission under GNU Affero General Public License version 3
* section 7
*
* If you modify this Program, or any covered work, by linking or combining it
* with other code, such other code is not for that reason alone subject to any
* of the requirements of the GNU Affero GPL version 3 as long as this Program
* is the same Program as licensed from Suomen Kanuuna Oy without any additional
* modifications.
*
* Supplemented terms under GNU Affero General Public License version 3
* section 7
*
* Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified
* versions must be marked as "Modified version of" The Program.
*
* Names of the licensors and authors may not be used for publicity purposes.
*
* No rights are granted for use of trade names, trademarks, or service marks
* which are in The Program if any.
*
* Licensee must indemnify licensors and authors for any liability that these
* contractual assumptions impose on licensors and authors.
*
* To the extent this program is licensed as part of the Commercial versions of
* Teragrep, the applicable Commercial License may apply to this file if you as
* a licensee so wish it.
*/
184 changes: 118 additions & 66 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<packaging>jar</packaging>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.teragrep</groupId>
<artifactId>pth_10</artifactId>
<version>${revision}${sha1}${changelist}</version>
<packaging>jar</packaging>
<name>pth_10</name>
<description>Data Processing Language (DPL) translator for Apache Spark</description>
<url>https://teragrep.com</url>
<groupId>com.teragrep</groupId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<revision>0.0.1</revision>
<changelist>-SNAPSHOT</changelist>
<sha1/>
<junit.jupiter.version>5.7.1</junit.jupiter.version>
<teragrep.rlp_01.version>4.0.1</teragrep.rlp_01.version>
<teragrep.rlp_03.version>1.7.6</teragrep.rlp_03.version>
<teragrep.pth_03.version>6.1.4</teragrep.pth_03.version>
<teragrep.jue_01.version>0.4.3</teragrep.jue_01.version>
<teragrep.rlo_06.version>4.3.0</teragrep.rlo_06.version>
<teragrep.pth_06.version>3.1.2</teragrep.pth_06.version>
<teragrep.dpf_02.version>3.0.0</teragrep.dpf_02.version>
<teragrep.dpf_03.version>10.0.1</teragrep.dpf_03.version>
<teragrep.jpr_01.version>3.1.1</teragrep.jpr_01.version>
</properties>
<licenses>
<license>
<name>GNU Affero General Public License v3.0</name>
Expand Down Expand Up @@ -60,6 +39,25 @@
<developerConnection>scm:git:git@github.com:teragrep/pth_10.git</developerConnection>
<url>https://github.com/teragrep/pth_10/tree/master</url>
</scm>
<properties>
<changelist>-SNAPSHOT</changelist>
<java.version>1.8</java.version>
<junit.jupiter.version>5.7.1</junit.jupiter.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0.0.1</revision>
<sha1></sha1>
<teragrep.dpf_02.version>3.0.0</teragrep.dpf_02.version>
<teragrep.dpf_03.version>10.0.1</teragrep.dpf_03.version>
<teragrep.jpr_01.version>3.1.1</teragrep.jpr_01.version>
<teragrep.jue_01.version>0.4.3</teragrep.jue_01.version>
<teragrep.pth_03.version>6.1.4</teragrep.pth_03.version>
<teragrep.pth_06.version>3.1.2</teragrep.pth_06.version>
<teragrep.rlo_06.version>4.3.0</teragrep.rlo_06.version>
<teragrep.rlp_01.version>4.0.1</teragrep.rlp_01.version>
<teragrep.rlp_03.version>1.7.6</teragrep.rlp_03.version>
</properties>
<dependencies>
<!--DPL-dependencies -->
<dependency>
Expand Down Expand Up @@ -165,11 +163,11 @@
<version>1.6.2</version>
</dependency>
<!-- sendemail pdf generation (Apache PDFBox wrapper) -->
<dependency>
<groupId>com.github.dhorions</groupId>
<artifactId>boxable</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>com.github.dhorions</groupId>
<artifactId>boxable</artifactId>
<version>1.7.0</version>
</dependency>
<!-- avro dataformat for testing -->
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-avro -->
<dependency>
Expand Down Expand Up @@ -258,6 +256,59 @@
<directory>${project.basedir}/target</directory>
<finalName>pth_10</finalName>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.30.0</version>
<configuration>
<java>
<eclipse>
<file>${project.basedir}/eclipse-java-formatter.xml</file>
<version>4.10.0</version>
</eclipse>
<removeUnusedImports></removeUnusedImports>
<licenseHeader>
<file>${project.basedir}/license-header</file>
</licenseHeader>
</java>
<pom>
<sortPom>
<!-- see https://github.com/diffplug/spotless/blob/main/plugin-maven/README.md#sortpom -->
<encoding>UTF-8</encoding>
<lineSeparator>\n</lineSeparator>
<expandEmptyElements>true</expandEmptyElements>
<keepBlankLines>false</keepBlankLines>
<nrOfIndentSpace>2</nrOfIndentSpace>
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
<sortProperties>true</sortProperties>
<sortModules>true</sortModules>
<sortExecutions>true</sortExecutions>
</sortPom>
</pom>
<formats>
<format>
<includes>
<include>.gitattributes</include>
<include>.gitignore</include>
</includes>
<trimTrailingWhitespace></trimTrailingWhitespace>
<endWithNewline></endWithNewline>
<indent>
<tabs>true</tabs>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand All @@ -276,7 +327,7 @@
<requireJavaVersion>
<version>[1.8,1.9)</version>
</requireJavaVersion>
<banDynamicVersions/>
<banDynamicVersions></banDynamicVersions>
<requirePluginVersions>
<message>All plugins are required to contain specific version.</message>
<unCheckedPluginList>org.apache.maven.plugins:maven-site-plugin,org.apache.maven.plugins:maven-resources-plugin,org.apache.maven.plugins:maven-clean-plugin,org.apache.maven.plugins:maven-install-plugin,org.apache.maven.plugins:maven-deploy-plugin</unCheckedPluginList>
Expand Down Expand Up @@ -323,21 +374,13 @@
<artifactId>apache-rat-plugin</artifactId>
<version>0.15</version>
<inherited>false</inherited>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
<licenses>
<license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
<notes>Also allow the license url to be https.</notes>
<patterns>
<pattern>https://github.com/teragrep/teragrep/blob/main/LICENSE</pattern>
<pattern>Copyright (C) 2019-2024 Suomen Kanuuna Oy</pattern>
</patterns>
</license>
</licenses>
Expand All @@ -362,8 +405,17 @@
<!-- dummy files -->
<exclude>src/test/resources/hdfslist/**</exclude>
<exclude>src/test/resources/csv/**</exclude>
<exclude>eclipse-java-formatter.xml</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -397,18 +449,18 @@
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<id>flatten.clean</id>
<goals>
<goal>flatten</goal>
<goal>clean</goal>
</goals>
<phase>clean</phase>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<id>flatten</id>
<goals>
<goal>clean</goal>
<goal>flatten</goal>
</goals>
<phase>process-resources</phase>
</execution>
</executions>
</plugin>
Expand All @@ -419,10 +471,10 @@
<executions>
<execution>
<id>add-source</id>
<phase>process-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<sources>
<source>target/generated-sources/antlr4</source>
Expand Down Expand Up @@ -451,10 +503,10 @@
<version>1.0.0</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>write-project-properties</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<outputFile>${project.build.outputDirectory}/maven.properties</outputFile>
</configuration>
Expand All @@ -466,6 +518,17 @@
<profiles>
<profile>
<id>publish-maven-central</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
Expand All @@ -475,10 +538,10 @@
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<phase>verify</phase>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand All @@ -490,20 +553,16 @@
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publish-github-packages</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/teragrep/pth_10</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>publish-github-packages</id>
<build>
<plugins>
<plugin>
Expand All @@ -513,10 +572,10 @@
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<phase>verify</phase>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand All @@ -528,13 +587,6 @@
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/teragrep/pth_10</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>
Loading

0 comments on commit 21d96c9

Please sign in to comment.