From e94eee1cf6cda618d9c1e2d1ca84d64edf29c11c Mon Sep 17 00:00:00 2001 From: HaoJin Yang <1245294786@qq.com> Date: Tue, 23 Jul 2024 21:15:00 +0800 Subject: [PATCH] chore: intro `editorconfig-maven-plugin` for verifying code style defined in `.editorconfig` (#614) --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- LICENSE | 2 +- .../hugegraph/structure/graph/Shard.java | 2 +- hugegraph-hubble/.prettierrc | 2 +- .../hugegraph/exception/GenericException.java | 68 +++++++++---------- .../resources/files/file_without_empty_line | 2 +- .../assembly/descriptor/assembly.xml | 2 +- hugegraph-tools/README.md | 2 +- .../assembly/descriptor/assembly.xml | 2 +- pom.xml | 31 +++++++++ 10 files changed, 73 insertions(+), 42 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6a910574a..356c8341d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -63,4 +63,4 @@ For example: - [ ] `Doc - TODO` - [ ] `Doc - Done` -- [ ] `Doc - No Need` \ No newline at end of file +- [ ] `Doc - No Need` diff --git a/LICENSE b/LICENSE index 7fb1d8925..5dec9a650 100644 --- a/LICENSE +++ b/LICENSE @@ -214,4 +214,4 @@ Apache 2.0 licenses The following file are provided under the Apache 2.0 License. hugegraph-hubble/hubble-fe/public/favicon.ico - hugegraph-hubble/hubble-fe/src/assets/imgs/logo.png \ No newline at end of file + hugegraph-hubble/hubble-fe/src/assets/imgs/logo.png diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Shard.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Shard.java index 3d778e345..970658adf 100644 --- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Shard.java +++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Shard.java @@ -71,4 +71,4 @@ public String toString() { return String.format("Shard{start=%s, end=%s, length=%s}", this.start, this.end, this.length); } -} \ No newline at end of file +} diff --git a/hugegraph-hubble/.prettierrc b/hugegraph-hubble/.prettierrc index d3bb60155..afb777869 100644 --- a/hugegraph-hubble/.prettierrc +++ b/hugegraph-hubble/.prettierrc @@ -3,4 +3,4 @@ "tabWidth": 2, "printWidth": 80, "trailingComma": "none" -} \ No newline at end of file +} diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/exception/GenericException.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/exception/GenericException.java index 36c23b8e0..2f41d40c2 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/exception/GenericException.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/exception/GenericException.java @@ -1,34 +1,34 @@ -/* - * - * 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. - */ - -package org.apache.hugegraph.exception; - -/** - * Used to wrap other unexpected exceptions like Client/ServerException, and convert them into this. - * This is typically done to handle exceptions uniformly in the hubble UI. - */ -public class GenericException extends ParameterizedException { - - public GenericException(ServerException e) { - super(e.getMessage(), e.getCause()); - } - - public GenericException(Exception e) { - super(e.getMessage(), e.getCause()); - } -} +/* + * + * 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. + */ + +package org.apache.hugegraph.exception; + +/** + * Used to wrap other unexpected exceptions like Client/ServerException, and convert them into this. + * This is typically done to handle exceptions uniformly in the hubble UI. + */ +public class GenericException extends ParameterizedException { + + public GenericException(ServerException e) { + super(e.getMessage(), e.getCause()); + } + + public GenericException(Exception e) { + super(e.getMessage(), e.getCause()); + } +} diff --git a/hugegraph-hubble/hubble-be/src/test/resources/files/file_without_empty_line b/hugegraph-hubble/hubble-be/src/test/resources/files/file_without_empty_line index 5f5fbe759..01e79c32a 100644 --- a/hugegraph-hubble/hubble-be/src/test/resources/files/file_without_empty_line +++ b/hugegraph-hubble/hubble-be/src/test/resources/files/file_without_empty_line @@ -1,3 +1,3 @@ 1 2 -3 \ No newline at end of file +3 diff --git a/hugegraph-loader/assembly/descriptor/assembly.xml b/hugegraph-loader/assembly/descriptor/assembly.xml index 62fe67935..b580fd2d9 100644 --- a/hugegraph-loader/assembly/descriptor/assembly.xml +++ b/hugegraph-loader/assembly/descriptor/assembly.xml @@ -67,4 +67,4 @@ - \ No newline at end of file + diff --git a/hugegraph-tools/README.md b/hugegraph-tools/README.md index 037930bfe..d81f7cd52 100644 --- a/hugegraph-tools/README.md +++ b/hugegraph-tools/README.md @@ -14,4 +14,4 @@ The [tools homepage](https://hugegraph.apache.org/docs/quickstart/hugegraph-tool ## License -HugeGraph-Tools is licensed under Apache 2.0 License. \ No newline at end of file +HugeGraph-Tools is licensed under Apache 2.0 License. diff --git a/hugegraph-tools/assembly/descriptor/assembly.xml b/hugegraph-tools/assembly/descriptor/assembly.xml index 38075356b..565cb9914 100644 --- a/hugegraph-tools/assembly/descriptor/assembly.xml +++ b/hugegraph-tools/assembly/descriptor/assembly.xml @@ -61,4 +61,4 @@ - \ No newline at end of file + diff --git a/pom.xml b/pom.xml index f18c954f4..eb0ae13cb 100644 --- a/pom.xml +++ b/pom.xml @@ -540,6 +540,37 @@ + + org.ec4j.maven + editorconfig-maven-plugin + 0.1.3 + + + style-check + + check + + verify + + + + + + + + + **/*.txt + **/.flattened-pom.xml + **/hubble-fe/**/* + **/apache-hugegraph-hubble-incubating-*/**/* + + + +