[ https://issues.apache.org/jira/browse/CLOUDSTACK-10254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16454192#comment-16454192 ]
ASF GitHub Bot commented on CLOUDSTACK-10254: --------------------------------------------- rafaelweingartner closed pull request #2422: [CLOUDSTACK-10254] checkstyle: add package name declaration validation URL: https://github.com/apache/cloudstack/pull/2422 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/QCOW2.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/QCOW2.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/QCOW2.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/Unknown.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/Unknown.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/Unknown.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHD.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHD.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHD.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHDX.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHDX.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VHDX.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VMDK.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VMDK.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VMDK.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskType.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskType.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskType.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeBase.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeBase.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeBase.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeHelper.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeHelper.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/disktype/VolumeDiskTypeHelper.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/storage/src/main/java/org/apache/cloudstack/storage/EndPoint.java b/engine/storage/src/main/java/org/apache/cloudstack/storage/EndPoint.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/storage/src/main/java/org/apache/cloudstack/storage/EndPoint.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/DataStore.java b/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/DataStore.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/DataStore.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java b/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java deleted file mode 100644 index b248758bc12..00000000000 --- a/engine/storage/src/main/java/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. diff --git a/pom.xml b/pom.xml index b1ff1021af1..c90da3b9cd3 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,8 @@ <cs.target.dir>target</cs.target.dir> <cs.daemon.version>1.1.0</cs.daemon.version> <cs.jna.version>4.0.0</cs.jna.version> - <cs.checkstyle.version>2.17</cs.checkstyle.version> + <cs.checkstyle.version>3.0.0</cs.checkstyle.version> + <cs.checkstyle-lib.version>8.7</cs.checkstyle-lib.version> <cs.mycila.license.version>2.11</cs.mycila.license.version> <cs.findbugs.version>3.0.3</cs.findbugs.version> <cs.javadoc.version>2.10.3</cs.javadoc.version> @@ -619,6 +620,11 @@ <artifactId>checkstyle</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.puppycrawl.tools</groupId> + <artifactId>checkstyle</artifactId> + <version>${cs.checkstyle-lib.version}</version> + </dependency> </dependencies> <executions> <execution> @@ -634,9 +640,11 @@ <configLocation>cloud-style.xml</configLocation> <consoleOutput>true</consoleOutput> <includeTestSourceDirectory>true</includeTestSourceDirectory> - <sourceDirectory>${project.basedir}</sourceDirectory> + <sourceDirectories> + <sourceDirectory>${project.basedir}</sourceDirectory> + </sourceDirectories> <includes>**\/*.java</includes> - <excludes>**\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/apidoc\/</excludes> + <excludes>**\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/XmlToHtmlConverter*,**\/generated-sources\/**\/*</excludes> </configuration> </plugin> <plugin> diff --git a/tools/checkstyle/pom.xml b/tools/checkstyle/pom.xml index 10fcda94ec2..a763994abf9 100644 --- a/tools/checkstyle/pom.xml +++ b/tools/checkstyle/pom.xml @@ -31,7 +31,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.13</version> + <version>3.0.0</version> <executions> <execution> <phase>none</phase> diff --git a/tools/checkstyle/src/main/resources/cloud-style.xml b/tools/checkstyle/src/main/resources/cloud-style.xml index 47ea1fb706e..6aaef17b926 100644 --- a/tools/checkstyle/src/main/resources/cloud-style.xml +++ b/tools/checkstyle/src/main/resources/cloud-style.xml @@ -21,7 +21,6 @@ <module name="LineLength"> <property name="max" value="1024" /> </module> - <module name="RedundantImport" /> <module name="UnusedImports" /> <module name="MemberName"> @@ -36,12 +35,13 @@ <module name="ConstantName"> <property name="format" value="^[a-zA-Z][a-zA-Z0-9_]*$"/> </module> - <module name="PackageName" /> + <module name="PackageDeclaration"><property name="matchDirectoryStructure" value="true"/></module> <module name="ParameterName" /> <module name="TypeName" /> <module name="AvoidStarImport" /> </module> + <module name="RegexpSingleline"> <!-- \s matches whitespace character, $ matches end of line. --> <property name="format" value="\s+$" /> ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Require checkstyle to verify package names against directory structure > ---------------------------------------------------------------------- > > Key: CLOUDSTACK-10254 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10254 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) > Reporter: Marc-Aurèle Brothier > Assignee: Marc-Aurèle Brothier > Priority: Major > Fix For: 4.12 > > > Enforce a new rule for checkstyle to verify that the java file location and > its package name match. -- This message was sent by Atlassian JIRA (v7.6.3#76005)