Skip to content

Commit

Permalink
bugfix: fix checkstyle plugin can't exclude single file (#2986)
Browse files Browse the repository at this point in the history
  • Loading branch information
slievrly authored Aug 7, 2020
1 parent 4887607 commit af42560
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private ApolloConfiguration() {
MAX_CONFIG_OPERATE_THREAD, Integer.MAX_VALUE, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(),
new NamedThreadFactory("apolloConfigOperate", MAX_CONFIG_OPERATE_THREAD));
config.addChangeListener((changeEvent) -> {
config.addChangeListener(changeEvent -> {
for (String key : changeEvent.changedKeys()) {
if (!LISTENER_SERVICE_MAP.containsKey(key)) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public void destroy() {

@Override
protected Function<String, NettyPoolKey> getPoolKeyFunction() {
return (serverAddress) -> {
return serverAddress -> {
String resourceIds = getMergedResourceKeys();
if (resourceIds != null && LOGGER.isInfoEnabled()) {
LOGGER.info("RM will register :{}", resourceIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void destroy() {

@Override
protected Function<String, NettyPoolKey> getPoolKeyFunction() {
return (severAddress) -> {
return severAddress -> {
RegisterTMRequest message = new RegisterTMRequest(applicationId, transactionServiceGroup);
return new NettyPoolKey(NettyPoolKey.TransactionRole.TMROLE, severAddress, message);
};
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<maven-source-plugin.version>2.2.1</maven-source-plugin.version>
<protobuf-maven-plugin.version>0.5.0</protobuf-maven-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
<maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>

<!-- for test -->
<junit-jupiter.version>5.4.2</junit-jupiter.version>
Expand Down Expand Up @@ -336,11 +336,10 @@
<phase>validate</phase>
<configuration>
<configLocation>${user.dir}/style/seata_checkstyle.xml</configLocation>
<suppressionsLocation>${user.dir}/style/seata_suppressions.xml</suppressionsLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<excludes>**/generated/**/*</excludes>
<excludes>io/seata/integration/grpc/interceptor/</excludes>
</configuration>
<goals>
<goal>checkstyle</goal>
Expand Down
30 changes: 30 additions & 0 deletions style/seata_suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>

<!--
~ Copyright 1999-2019 Seata.io Group.
~
~ Licensed 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.
-->

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
"https://checkstyle.org/dtds/suppressions_1_0.dtd">

<suppressions>
<suppress checks="RegexpSinglelineCheck"
files="ConfigTools.java"/>
<suppress checks=".*"
files="[/\\]generated[/\\]"/>
<suppress checks=".*"
files="io[\\/]seata[\\/]integration[\\/]grpc[\\/]interceptor[\\/]"/>
</suppressions>

0 comments on commit af42560

Please sign in to comment.