From c46379f6a8c6387bf18ecaec653ddfddb4edb67d Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sat, 10 Dec 2022 22:54:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=8F=82=E7=85=A7?= =?UTF-8?q?=20alibaba/easyexcel=20=E9=85=8D=E7=BD=AE=20P3C=EF=BC=88?= =?UTF-8?q?=E9=98=BF=E9=87=8C=E5=B7=B4=E5=B7=B4=20Java=20=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=89=8B=E5=86=8C=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=EF=BC=89=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=AF=B9=E7=8E=B0=E6=9C=89=E4=BB=A3=E7=A0=81=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E4=BA=86=E6=A0=BC=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code-style/STYLE.md | 8 + code-style/code-formatter.xml | 511 ++++++++++++++++++ code-style/spotless-formatter.xml | 48 -- .../charles7c/ContinewAdminApplication.java | 8 +- .../ContinewAdminApplicationTests.java | 7 +- pom.xml | 2 +- 6 files changed, 527 insertions(+), 57 deletions(-) create mode 100644 code-style/STYLE.md create mode 100644 code-style/code-formatter.xml delete mode 100644 code-style/spotless-formatter.xml diff --git a/code-style/STYLE.md b/code-style/STYLE.md new file mode 100644 index 00000000..308f1bdc --- /dev/null +++ b/code-style/STYLE.md @@ -0,0 +1,8 @@ +## 统一代码风格 + +如果要编辑本项目,一定要统一代码风格 + +### 统一方案 + +本工程代码遵守阿里巴巴 [p3c](https://github.com/alibaba/p3c) 规范,在代码开发前建议: +* 安装阿里巴巴规约插件,用于提早发现不规范代码,具体安装方法参照:[p3c](https://github.com/alibaba/p3c),里面有 Eclipse,IntelliJ IDEA 的安装方法 \ No newline at end of file diff --git a/code-style/code-formatter.xml b/code-style/code-formatter.xml new file mode 100644 index 00000000..00f18151 --- /dev/null +++ b/code-style/code-formatter.xml @@ -0,0 +1,511 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code-style/spotless-formatter.xml b/code-style/spotless-formatter.xml deleted file mode 100644 index 45a21b71..00000000 --- a/code-style/spotless-formatter.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/continew-admin-webapi/src/main/java/top/charles7c/ContinewAdminApplication.java b/continew-admin-webapi/src/main/java/top/charles7c/ContinewAdminApplication.java index bd54e8e2..07ff5541 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/ContinewAdminApplication.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/ContinewAdminApplication.java @@ -38,21 +38,21 @@ import lombok.extern.slf4j.Slf4j; @RestController @SpringBootApplication public class ContinewAdminApplication { - + private static Environment env; - + @SneakyThrows public static void main(String[] args) { SpringApplication application = new SpringApplication(ContinewAdminApplication.class); ConfigurableApplicationContext context = application.run(args); - + env = context.getEnvironment(); log.info("------------------------------------------------------"); log.info("{} backend service started successfully.", env.getProperty("continew-admin.name")); log.info("后端 API 地址:http://{}:{}", InetAddress.getLocalHost().getHostAddress(), env.getProperty("server.port")); log.info("------------------------------------------------------"); } - + /** * 访问首页提示 * diff --git a/continew-admin-webapi/src/test/java/top/charles7c/ContinewAdminApplicationTests.java b/continew-admin-webapi/src/test/java/top/charles7c/ContinewAdminApplicationTests.java index 37f5da96..6764a31a 100644 --- a/continew-admin-webapi/src/test/java/top/charles7c/ContinewAdminApplicationTests.java +++ b/continew-admin-webapi/src/test/java/top/charles7c/ContinewAdminApplicationTests.java @@ -21,9 +21,8 @@ import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ContinewAdminApplicationTests { - + @Test - void contextLoads() { - } - + void contextLoads() {} + } diff --git a/pom.xml b/pom.xml index bd1dfd81..3c207e52 100644 --- a/pom.xml +++ b/pom.xml @@ -122,7 +122,7 @@ limitations under the License. - code-style/spotless-formatter.xml + code-style/code-formatter.xml code-style/license-header