Skip to content

Commit 31e9920

Browse files
committed
add spotless plugin and apply
# Conflicts: # src/test/java/com/teragrep/pth_03/tests/TeragrepSyntaxTests.java
1 parent 5028f56 commit 31e9920

484 files changed

Lines changed: 4410 additions & 3653 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eclipse-java-formatter.xml

Lines changed: 449 additions & 0 deletions
Large diffs are not rendered by default.

license-header

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Data Processing Language (DPL) parser
3+
* Copyright (C) 2025 Suomen Kanuuna Oy
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
*
19+
* Additional permission under GNU Affero General Public License version 3
20+
* section 7
21+
*
22+
* If you modify this Program, or any covered work, by linking or combining it
23+
* with other code, such other code is not for that reason alone subject to any
24+
* of the requirements of the GNU Affero GPL version 3 as long as this Program
25+
* is the same Program as licensed from Suomen Kanuuna Oy without any additional
26+
* modifications.
27+
*
28+
* Supplemented terms under GNU Affero General Public License version 3
29+
* section 7
30+
*
31+
* Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified
32+
* versions must be marked as "Modified version of" The Program.
33+
*
34+
* Names of the licensors and authors may not be used for publicity purposes.
35+
*
36+
* No rights are granted for use of trade names, trademarks, or service marks
37+
* which are in The Program if any.
38+
*
39+
* Licensee must indemnify licensors and authors for any liability that these
40+
* contractual assumptions impose on licensors and authors.
41+
*
42+
* To the extent this program is licensed as part of the Commercial versions of
43+
* Teragrep, the applicable Commercial License may apply to this file if you as
44+
* a licensee so wish it.
45+
*/

pom.xml

Lines changed: 115 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<packaging>jar</packaging>
2+
<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">
63
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.teragrep</groupId>
75
<artifactId>pth_03</artifactId>
86
<version>${revision}${sha1}${changelist}</version>
7+
<packaging>jar</packaging>
98
<name>pth_03</name>
109
<description>Data Processing Language (DPL) parser</description>
11-
<groupId>com.teragrep</groupId>
1210
<url>https://teragrep.com</url>
13-
<properties>
14-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<maven.compiler.source>1.8</maven.compiler.source>
16-
<maven.compiler.target>1.8</maven.compiler.target>
17-
<java.version>1.8</java.version>
18-
<revision>0.0.2</revision>
19-
<changelist>-SNAPSHOT</changelist>
20-
<sha1/>
21-
<junit.jupiter.version>5.7.1</junit.jupiter.version>
22-
<antlr4.version>4.9.3</antlr4.version>
23-
</properties>
24-
<scm>
25-
<connection>scm:git:https://github.com/teragrep/pth_03.git</connection>
26-
<developerConnection>scm:git:[email protected]:teragrep/pth_03.git</developerConnection>
27-
<url>https://github.com/teragrep/pth_03/tree/master</url>
28-
</scm>
2911
<licenses>
3012
<license>
3113
<name>GNU Affero General Public License v3.0</name>
@@ -40,6 +22,22 @@
4022
<organizationUrl>https://teragrep.com</organizationUrl>
4123
</developer>
4224
</developers>
25+
<scm>
26+
<connection>scm:git:https://github.com/teragrep/pth_03.git</connection>
27+
<developerConnection>scm:git:[email protected]:teragrep/pth_03.git</developerConnection>
28+
<url>https://github.com/teragrep/pth_03/tree/master</url>
29+
</scm>
30+
<properties>
31+
<antlr4.version>4.9.3</antlr4.version>
32+
<changelist>-SNAPSHOT</changelist>
33+
<java.version>1.8</java.version>
34+
<junit.jupiter.version>5.7.1</junit.jupiter.version>
35+
<maven.compiler.source>1.8</maven.compiler.source>
36+
<maven.compiler.target>1.8</maven.compiler.target>
37+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38+
<revision>0.0.2</revision>
39+
<sha1></sha1>
40+
</properties>
4341
<dependencies>
4442
<!-- logger -->
4543
<dependency>
@@ -53,13 +51,13 @@
5351
<groupId>org.antlr</groupId>
5452
<artifactId>antlr4</artifactId>
5553
<version>${antlr4.version}</version>
54+
<optional>true</optional>
5655
<exclusions>
5756
<exclusion>
5857
<groupId>org.antlr</groupId>
5958
<artifactId>antlr-runtime</artifactId>
6059
</exclusion>
6160
</exclusions>
62-
<optional>true</optional>
6361
</dependency>
6462
<dependency>
6563
<groupId>org.junit.jupiter</groupId>
@@ -97,7 +95,7 @@
9795
<requireJavaVersion>
9896
<version>[1.8,1.9)</version>
9997
</requireJavaVersion>
100-
<banDynamicVersions/>
98+
<banDynamicVersions></banDynamicVersions>
10199
<requirePluginVersions>
102100
<message>All plugins are required to contain specific version.</message>
103101
<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,org.apache.maven.plugins:maven-compiler-plugin,org.apache.maven.plugins:maven-jar-plugin</unCheckedPluginList>
@@ -144,21 +142,25 @@
144142
<artifactId>apache-rat-plugin</artifactId>
145143
<version>0.15</version>
146144
<inherited>false</inherited>
147-
<executions>
148-
<execution>
149-
<phase>test</phase>
150-
<goals>
151-
<goal>check</goal>
152-
</goals>
153-
</execution>
154-
</executions>
155145
<configuration>
156146
<addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
157147
<licenses>
158148
<license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
159149
<notes>Also allow the license url to be https.</notes>
160150
<patterns>
161-
<pattern>https://github.com/teragrep/teragrep/blob/main/LICENSE</pattern>
151+
<pattern>Copyright (C) 2025 Suomen Kanuuna Oy</pattern>
152+
</patterns>
153+
</license>
154+
<license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
155+
<notes>Also allow the license url to be https.</notes>
156+
<patterns>
157+
<pattern>Copyright (C) 2019, 2020, 2021, 2022 Suomen Kanuuna Oy</pattern>
158+
</patterns>
159+
</license>
160+
<license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
161+
<notes>Also allow the license url to be https.</notes>
162+
<patterns>
163+
<pattern>Copyright (C) 2019, 2020, 2021, 2022, 2023 Suomen Kanuuna Oy</pattern>
162164
</patterns>
163165
</license>
164166
</licenses>
@@ -177,13 +179,22 @@
177179
<exclude>.github/pull_request_template.md</exclude>
178180
<exclude>toolchains.xml</exclude>
179181
<exclude>settings.xml</exclude>
182+
<exclude>eclipse-java-formatter.xml</exclude>
180183
<!-- readme -->
181184
<exclude>README.adoc</exclude>
182185
<exclude>README.md</exclude>
183186
<!-- other maven files -->
184187
<exclude>.flattened-pom.xml</exclude>
185188
</excludes>
186189
</configuration>
190+
<executions>
191+
<execution>
192+
<goals>
193+
<goal>check</goal>
194+
</goals>
195+
<phase>test</phase>
196+
</execution>
197+
</executions>
187198
</plugin>
188199
<plugin>
189200
<groupId>org.antlr</groupId>
@@ -207,10 +218,10 @@
207218
<executions>
208219
<execution>
209220
<id>add-source</id>
210-
<phase>process-sources</phase>
211221
<goals>
212222
<goal>add-source</goal>
213223
</goals>
224+
<phase>process-sources</phase>
214225
<configuration>
215226
<sources>
216227
<source>target/generated-sources/antlr4</source>
@@ -234,10 +245,10 @@
234245
<version>3.2.4</version>
235246
<executions>
236247
<execution>
237-
<phase>package</phase>
238248
<goals>
239249
<goal>shade</goal>
240250
</goals>
251+
<phase>package</phase>
241252
<configuration>
242253
<createDependencyReducedPom>false</createDependencyReducedPom>
243254
<relocations>
@@ -259,19 +270,77 @@
259270
<flattenMode>resolveCiFriendliesOnly</flattenMode>
260271
</configuration>
261272
<executions>
273+
<execution>
274+
<id>flatten.clean</id>
275+
<goals>
276+
<goal>clean</goal>
277+
</goals>
278+
<phase>clean</phase>
279+
</execution>
262280
<execution>
263281
<id>flatten</id>
264-
<phase>process-resources</phase>
265282
<goals>
266283
<goal>flatten</goal>
267284
</goals>
285+
<phase>process-resources</phase>
268286
</execution>
287+
</executions>
288+
</plugin>
289+
<plugin>
290+
<groupId>com.diffplug.spotless</groupId>
291+
<artifactId>spotless-maven-plugin</artifactId>
292+
<version>2.30.0</version>
293+
<configuration>
294+
<java>
295+
<eclipse>
296+
<file>${project.basedir}/eclipse-java-formatter.xml</file>
297+
<version>4.10.0</version>
298+
</eclipse>
299+
<removeUnusedImports></removeUnusedImports>
300+
<licenseHeader>
301+
<file>${project.basedir}/license-header</file>
302+
</licenseHeader>
303+
</java>
304+
<antlr4>
305+
<licenseHeader>
306+
<file>${project.basedir}/license-header</file>
307+
</licenseHeader>
308+
</antlr4>
309+
<pom>
310+
<sortPom>
311+
<!-- see https://github.com/diffplug/spotless/blob/main/plugin-maven/README.md#sortpom -->
312+
<encoding>UTF-8</encoding>
313+
<lineSeparator>\n</lineSeparator>
314+
<expandEmptyElements>true</expandEmptyElements>
315+
<keepBlankLines>false</keepBlankLines>
316+
<nrOfIndentSpace>2</nrOfIndentSpace>
317+
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
318+
<sortProperties>true</sortProperties>
319+
<sortModules>true</sortModules>
320+
<sortExecutions>true</sortExecutions>
321+
</sortPom>
322+
</pom>
323+
<formats>
324+
<format>
325+
<includes>
326+
<include>.gitattributes</include>
327+
<include>.gitignore</include>
328+
</includes>
329+
<trimTrailingWhitespace></trimTrailingWhitespace>
330+
<endWithNewline></endWithNewline>
331+
<indent>
332+
<tabs>true</tabs>
333+
<spacesPerTab>4</spacesPerTab>
334+
</indent>
335+
</format>
336+
</formats>
337+
</configuration>
338+
<executions>
269339
<execution>
270-
<id>flatten.clean</id>
271-
<phase>clean</phase>
272340
<goals>
273-
<goal>clean</goal>
341+
<goal>check</goal>
274342
</goals>
343+
<phase>compile</phase>
275344
</execution>
276345
</executions>
277346
</plugin>
@@ -344,6 +413,13 @@
344413
</profile>
345414
<profile>
346415
<id>publish-github-packages</id>
416+
<distributionManagement>
417+
<repository>
418+
<id>github</id>
419+
<name>GitHub Packages</name>
420+
<url>https://maven.pkg.github.com/teragrep/pth_03</url>
421+
</repository>
422+
</distributionManagement>
347423
<build>
348424
<plugins>
349425
<plugin>
@@ -353,10 +429,10 @@
353429
<executions>
354430
<execution>
355431
<id>sign-artifacts</id>
356-
<phase>verify</phase>
357432
<goals>
358433
<goal>sign</goal>
359434
</goals>
435+
<phase>verify</phase>
360436
<configuration>
361437
<gpgArguments>
362438
<arg>--pinentry-mode</arg>
@@ -368,13 +444,6 @@
368444
</plugin>
369445
</plugins>
370446
</build>
371-
<distributionManagement>
372-
<repository>
373-
<id>github</id>
374-
<name>GitHub Packages</name>
375-
<url>https://maven.pkg.github.com/teragrep/pth_03</url>
376-
</repository>
377-
</distributionManagement>
378447
</profile>
379448
</profiles>
380449
</project>

src/main/antlr4/com/teragrep/pth_03/antlr/DPLLexer.g4

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Teragrep Data Processing Language Parser Library PTH-03
3-
* Copyright (C) 2019, 2020, 2021, 2022 Suomen Kanuuna Oy
2+
* Data Processing Language (DPL) parser
3+
* Copyright (C) 2025 Suomen Kanuuna Oy
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Affero General Public License as published by
@@ -13,7 +13,7 @@
1313
* GNU Affero General Public License for more details.
1414
*
1515
* You should have received a copy of the GNU Affero General Public License
16-
* along with this program. If not, see <https://github.com/teragrep/teragrep/blob/main/LICENSE>.
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*
1818
*
1919
* Additional permission under GNU Affero General Public License version 3
@@ -43,7 +43,6 @@
4343
* Teragrep, the applicable Commercial License may apply to this file if you as
4444
* a licensee so wish it.
4545
*/
46-
// -*- mode: conf; -*-
4746
lexer grammar DPLLexer;
4847

4948
import GET_BOOLEAN, GET_INTEGER, GET_FIELD, GET_NUMBER, GET_INDEX_STRING, GET_REGEX_STRING, GET_SORT_FIELD, GET_TIME, GET_SPAN, GET_STRING, GET_WHERE_MODE, GET_WHERE_MODE_BY ,GET_T_OR_B, COMMAND_ABSTRACT_MODE, COMMAND_ACCUM_MODE, COMMAND_ADDCOLTOTALS_MODE, COMMAND_ADDINFO_MODE, COMMAND_ADDTOTALS_MODE, COMMAND_AGGREGATION_MODE, COMMAND_ANALYZEFIELDS_MODE, COMMAND_ANOMALIES_MODE, COMMAND_ANOMALOUSVALUE_MODE, COMMAND_ANOMALYDETECTION_MODE, COMMAND_APPENDCOLS_MODE, COMMAND_APPEND_MODE, COMMAND_APPENDPIPE_MODE, COMMAND_ARULES_MODE, COMMAND_ASSOCIATE_MODE, COMMAND_AUDIT_MODE, COMMAND_AUTOREGRESS_MODE, COMMAND_BIN_MODE, COMMAND_BUCKETDIR_MODE, COMMAND_CHART_MODE, COMMAND_CLUSTER_MODE, COMMAND_COFILTER_MODE, COMMAND_COLLAPSE_MODE, COMMAND_COLLECT_MODE, COMMAND_CONCURRENCY_MODE, COMMAND_CONTINGENCY_MODE, COMMAND_CONVERT_MODE, COMMAND_CORRELATE_MODE, COMMAND_DATAMODEL_MODE, COMMAND_DBINSPECT_MODE, COMMAND_DEDUP_MODE, COMMAND_DELETE_MODE, COMMAND_DELTA_MODE, COMMAND_DIFF_MODE, COMMAND_DPL_MODE, COMMAND_DUMP_MODE, COMMAND_EREX_MODE, COMMAND_EVAL_SUBMODE_BASE, EVAL_LANGUAGE_MODE, COMMAND_EVENTCOUNT_MODE, COMMAND_EVENTSTATS_MODE, COMMAND_EXPLAIN_MODE, COMMAND_EXTRACT_MODE, COMMAND_FIELDS_MODE, COMMAND_FIELDFORMAT_MODE, COMMAND_FIELDSUMMARY_MODE, COMMAND_FILLDOWN_MODE, COMMAND_FILLNULL_MODE, COMMAND_FINDKEYWORDS_MODE, COMMAND_FINDTYPES_MODE, COMMAND_FOLDERIZE_MODE, COMMAND_FOREACH_MODE, COMMAND_FORMAT_MODE, COMMAND_FROM_MODE, COMMAND_GAUGE_MODE, COMMAND_GENTIMES_MODE, COMMAND_GEOMFILTER_MODE, COMMAND_GEOM_MODE, COMMAND_GEOSTATS_MODE, COMMAND_HEAD_MODE, COMMAND_HIGHLIGHT_MODE, COMMAND_HISTORY_MODE, COMMAND_ICONIFY_MODE, COMMAND_INPUTCSV_MODE, COMMAND_INPUTLOOKUP_MODE, COMMAND_IPLOCATION_MODE, COMMAND_JOIN_MODE, COMMAND_KMEANS_MODE, COMMAND_KVFORM_MODE, COMMAND_LOADJOB_MODE, COMMAND_LOCALIZE_MODE, COMMAND_LOCALOP_MODE, COMMAND_LOOKUP_MODE, COMMAND_MAKECONTINUOUS_MODE, COMMAND_MAKEJSON_MODE, COMMAND_MAKEMV_MODE, COMMAND_MAKERESULTS_MODE, COMMAND_MAP_MODE, COMMAND_MCATALOG_MODE, COMMAND_MCOLLECT_MODE, COMMAND_METADATA_MODE, COMMAND_METASEARCH_MODE, COMMAND_MEVENTCOLLECT_MODE, COMMAND_MSTATS_MODE, COMMAND_MULTIKV_MODE, COMMAND_MULTISEARCH_MODE, COMMAND_MVCOMBINE_MODE, COMMAND_MVEXPAND_MODE, COMMAND_NOMV_MODE, COMMAND_OUTLIER_MODE, COMMAND_OUTPUTCSV_MODE, COMMAND_OUTPUTLOOKUP_MODE, COMMAND_OUTPUTTEXT_MODE, COMMAND_OVERLAP_MODE, COMMAND_PIVOT_MODE, COMMAND_PREDICT_MODE, COMMAND_RANGEMAP_MODE, COMMAND_RARE_MODE, COMMAND_REDISTRIBUTE_MODE, COMMAND_REGEX_MODE, COMMAND_RELEVANCY_MODE, COMMAND_RELTIME_MODE, COMMAND_RENAME_MODE, COMMAND_REPLACE_MODE, COMMAND_REST_MODE, COMMAND_RETURN_MODE, COMMAND_REVERSE_MODE, COMMAND_REX_MODE, COMMAND_REX4J_MODE, COMMAND_RTORDER_MODE, COMMAND_RUNSHELLSCRIPT_MODE, COMMAND_SAVEDSEARCH_MODE, COMMAND_SCRIPT_MODE, COMMAND_SCRUB_MODE, COMMAND_SEARCH_MODE, COMMAND_SEARCHTXN_MODE, COMMAND_SELFJOIN_MODE, COMMAND_SENDALERT_MODE, COMMAND_SENDEMAIL_MODE, COMMAND_SETFIELDS_MODE, COMMAND_SET_MODE, COMMAND_SICHART_MODE, COMMAND_SIRARE_MODE, COMMAND_SISTATS_MODE, COMMAND_SITIMECHART_MODE, COMMAND_SITOP_MODE, COMMAND_SORT_MODE, COMMAND_SPATH_MODE, COMMAND_STATS_MODE, COMMAND_STRCAT_MODE, COMMAND_STREAMSTATS_MODE, COMMAND_TABLE_MODE, COMMAND_TAGS_MODE, COMMAND_TAIL_MODE, COMMAND_TERAGREP_MODE, COMMAND_TIMECHART_MODE, COMMAND_TIMEWRAP_MODE, COMMAND_TOP_MODE, COMMAND_TRANSACTION_MODE, COMMAND_TRANSPOSE_MODE, COMMAND_TRENDLINE_MODE, COMMAND_TSCOLLECT_MODE, COMMAND_TSTATS_MODE, COMMAND_TYPEAHEAD_MODE, COMMAND_TYPELEARNER_MODE, COMMAND_TYPER_MODE, COMMAND_UNION_MODE, COMMAND_UNIQ_MODE, COMMAND_UNTABLE_MODE, COMMAND_WHERE_MODE, COMMAND_X11_MODE, COMMAND_XMLKV_MODE, COMMAND_XMLUNESCAPE_MODE, COMMAND_XPATH_MODE, COMMAND_XYSERIES_MODE;

src/main/antlr4/com/teragrep/pth_03/antlr/DPLParser.g4

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Teragrep Data Processing Language Parser Library PTH-03
3-
* Copyright (C) 2019, 2020, 2021, 2022 Suomen Kanuuna Oy
2+
* Data Processing Language (DPL) parser
3+
* Copyright (C) 2025 Suomen Kanuuna Oy
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Affero General Public License as published by
@@ -13,7 +13,7 @@
1313
* GNU Affero General Public License for more details.
1414
*
1515
* You should have received a copy of the GNU Affero General Public License
16-
* along with this program. If not, see <https://github.com/teragrep/teragrep/blob/main/LICENSE>.
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*
1818
*
1919
* Additional permission under GNU Affero General Public License version 3
@@ -43,7 +43,6 @@
4343
* Teragrep, the applicable Commercial License may apply to this file if you as
4444
* a licensee so wish it.
4545
*/
46-
// -*- mode: conf; -*-
4746
parser grammar DPLParser;
4847

4948
@parser::members {

0 commit comments

Comments
 (0)