This is an automated email from the ASF dual-hosted git repository. twalthr pushed a commit to branch release-1.15 in repository https://gitbox.apache.org/repos/asf/flink.git
commit 01ca3f8939ce53d24f599017b90b034a638e54ed Author: Chesnay Schepler <ches...@apache.org> AuthorDate: Thu Apr 14 14:08:46 2022 +0200 [FLINK-27232][build] Explicitly configure scalafmt in each module --- .../flink-hadoop-compatibility/pom.xml | 16 +++++++ flink-connectors/flink-hcatalog/pom.xml | 16 +++++++ .../flink-end-to-end-tests-scala/pom.xml | 16 +++++++ .../flink-quickstart-test/pom.xml | 21 ++++++++++ flink-examples/flink-examples-batch/pom.xml | 16 +++++++ flink-examples/flink-examples-streaming/pom.xml | 16 +++++++ flink-examples/flink-examples-table/pom.xml | 16 +++++++ flink-libraries/flink-cep-scala/pom.xml | 17 ++++++++ flink-libraries/flink-gelly-examples/pom.xml | 17 ++++++++ flink-libraries/flink-gelly-scala/pom.xml | 16 +++++++ flink-scala/pom.xml | 17 ++++++++ flink-streaming-scala/pom.xml | 17 ++++++++ flink-table/flink-table-api-scala-bridge/pom.xml | 16 +++++++ flink-table/flink-table-api-scala/pom.xml | 16 +++++++ flink-table/flink-table-planner/pom.xml | 16 +++++++ flink-tests/pom.xml | 17 ++++++++ pom.xml | 49 ++++++++++------------ 17 files changed, 287 insertions(+), 28 deletions(-) diff --git a/flink-connectors/flink-hadoop-compatibility/pom.xml b/flink-connectors/flink-hadoop-compatibility/pom.xml index 7ec965570a5..9186f05a5f7 100644 --- a/flink-connectors/flink-hadoop-compatibility/pom.xml +++ b/flink-connectors/flink-hadoop-compatibility/pom.xml @@ -100,6 +100,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- activate API compatibility checks --> <plugin> <groupId>com.github.siom79.japicmp</groupId> diff --git a/flink-connectors/flink-hcatalog/pom.xml b/flink-connectors/flink-hcatalog/pom.xml index fa222d8bb2b..b98817870ee 100644 --- a/flink-connectors/flink-hcatalog/pom.xml +++ b/flink-connectors/flink-hcatalog/pom.xml @@ -97,6 +97,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-end-to-end-tests/flink-end-to-end-tests-scala/pom.xml b/flink-end-to-end-tests/flink-end-to-end-tests-scala/pom.xml index 03a94cf5371..2f32bb30b07 100644 --- a/flink-end-to-end-tests/flink-end-to-end-tests-scala/pom.xml +++ b/flink-end-to-end-tests/flink-end-to-end-tests-scala/pom.xml @@ -82,6 +82,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> diff --git a/flink-end-to-end-tests/flink-quickstart-test/pom.xml b/flink-end-to-end-tests/flink-quickstart-test/pom.xml index 634c1851fff..1a2e8b6af0f 100644 --- a/flink-end-to-end-tests/flink-quickstart-test/pom.xml +++ b/flink-end-to-end-tests/flink-quickstart-test/pom.xml @@ -60,4 +60,25 @@ under the License. <version>${project.version}</version> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/flink-examples/flink-examples-batch/pom.xml b/flink-examples/flink-examples-batch/pom.xml index 13eecd44db1..10af26aa70f 100644 --- a/flink-examples/flink-examples-batch/pom.xml +++ b/flink-examples/flink-examples-batch/pom.xml @@ -55,6 +55,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- Fail compilation on deprecation warnings to prevent from showing users outdated examples. --> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/flink-examples/flink-examples-streaming/pom.xml b/flink-examples/flink-examples-streaming/pom.xml index 5d1d0dd5ef2..aaee6c1efa8 100644 --- a/flink-examples/flink-examples-streaming/pom.xml +++ b/flink-examples/flink-examples-streaming/pom.xml @@ -124,6 +124,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- Fail compilation on deprecation warnings to prevent from showing users outdated examples. --> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/flink-examples/flink-examples-table/pom.xml b/flink-examples/flink-examples-table/pom.xml index 1c09ec52ad1..cc126ff93f9 100644 --- a/flink-examples/flink-examples-table/pom.xml +++ b/flink-examples/flink-examples-table/pom.xml @@ -97,6 +97,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> diff --git a/flink-libraries/flink-cep-scala/pom.xml b/flink-libraries/flink-cep-scala/pom.xml index 19d9c634179..e35b50f0d69 100644 --- a/flink-libraries/flink-cep-scala/pom.xml +++ b/flink-libraries/flink-cep-scala/pom.xml @@ -109,6 +109,23 @@ under the License. <!-- Not strictly necessary because of the build-helper-maven-plugin below. --> <sourceDirectory>src/main/scala</sourceDirectory> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> + <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-libraries/flink-gelly-examples/pom.xml b/flink-libraries/flink-gelly-examples/pom.xml index a5dc0070d3d..72345f9534f 100644 --- a/flink-libraries/flink-gelly-examples/pom.xml +++ b/flink-libraries/flink-gelly-examples/pom.xml @@ -121,6 +121,23 @@ <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> + <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-libraries/flink-gelly-scala/pom.xml b/flink-libraries/flink-gelly-scala/pom.xml index be918e10c2f..e930bc4e45e 100644 --- a/flink-libraries/flink-gelly-scala/pom.xml +++ b/flink-libraries/flink-gelly-scala/pom.xml @@ -96,6 +96,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-scala/pom.xml b/flink-scala/pom.xml index c4de68fb589..418b33399e7 100644 --- a/flink-scala/pom.xml +++ b/flink-scala/pom.xml @@ -139,6 +139,23 @@ under the License. </executions> </plugin> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> + <!-- activate API compatibility checks --> <plugin> <groupId>com.github.siom79.japicmp</groupId> diff --git a/flink-streaming-scala/pom.xml b/flink-streaming-scala/pom.xml index d6533c3482a..5126519ea7d 100644 --- a/flink-streaming-scala/pom.xml +++ b/flink-streaming-scala/pom.xml @@ -135,6 +135,23 @@ under the License. </executions> </plugin> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> + <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-table/flink-table-api-scala-bridge/pom.xml b/flink-table/flink-table-api-scala-bridge/pom.xml index 38381c1ae5a..4a31d9f1a94 100644 --- a/flink-table/flink-table-api-scala-bridge/pom.xml +++ b/flink-table/flink-table-api-scala-bridge/pom.xml @@ -77,6 +77,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-table/flink-table-api-scala/pom.xml b/flink-table/flink-table-api-scala/pom.xml index fde30cccf6b..b2a9248d651 100644 --- a/flink-table/flink-table-api-scala/pom.xml +++ b/flink-table/flink-table-api-scala/pom.xml @@ -88,6 +88,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-table/flink-table-planner/pom.xml b/flink-table/flink-table-planner/pom.xml index e059cbdbf00..d16df6271df 100644 --- a/flink-table/flink-table-planner/pom.xml +++ b/flink-table/flink-table-planner/pom.xml @@ -280,6 +280,22 @@ under the License. <build> <plugins> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/flink-tests/pom.xml b/flink-tests/pom.xml index 0cfbe29ad93..421ff9113ae 100644 --- a/flink-tests/pom.xml +++ b/flink-tests/pom.xml @@ -279,6 +279,23 @@ under the License. </executions> </plugin> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <configuration> + <scala> + <scalafmt> + <version>${spotless.scalafmt.version}</version> + <file>../.scalafmt.conf</file> + </scalafmt> + <licenseHeader> + <content>${spotless.license.header}</content> + <delimiter>${spotless.delimiter}</delimiter> + </licenseHeader> + </scala> + </configuration> + </plugin> + <!-- Scala Compiler --> <plugin> <groupId>net.alchim31.maven</groupId> diff --git a/pom.xml b/pom.xml index a03c6ba60e2..849829b0b6a 100644 --- a/pom.xml +++ b/pom.xml @@ -158,6 +158,27 @@ under the License. <japicmp.referenceVersion>1.15.0</japicmp.referenceVersion> <japicmp.outputDir>tools/japicmp-output</japicmp.outputDir> <spotless.version>2.13.0</spotless.version> + <spotless.scalafmt.version>3.4.3</spotless.scalafmt.version> + <spotless.delimiter>package</spotless.delimiter> + <spotless.license.header> +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + </spotless.license.header> <!-- Can be set to any value to reproduce a specific build. --> <test.randomization.seed/> @@ -1959,34 +1980,6 @@ under the License. <removeUnusedImports /> </java> - <scala> - <scalafmt> - <version>3.4.3</version> - <!-- This file is in the root of the project to make sure IntelliJ picks it up automatically --> - <file>.scalafmt.conf</file> - </scalafmt> - <licenseHeader> - <content>/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -</content> - <delimiter>package </delimiter> - </licenseHeader> - </scala> </configuration> <executions> <execution>