From ebfcf76ab488e332f425b58be6d090bcd0aafe91 Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Sat, 9 Dec 2023 21:22:31 +0100 Subject: [PATCH] Introdude formatter and impsort; make sure CI checks formatting --- .github/workflows/ci-actions.yml | 2 +- .gitignore | 1 + ide-config/pom.xml | 22 ++ ide-config/src/main/resources/cdi-format.xml | 322 ++++++++++++++++++ ide-config/src/main/resources/cdi.importorder | 6 + pom.xml | 133 ++++++++ 6 files changed, 485 insertions(+), 1 deletion(-) create mode 100644 ide-config/pom.xml create mode 100644 ide-config/src/main/resources/cdi-format.xml create mode 100644 ide-config/src/main/resources/cdi.importorder diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 45aa18058..a5c4c62a8 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -24,7 +24,7 @@ jobs: java-version: ${{ matrix.java }} - name: "Maven install" run: | - mvn -Pstaging install -DskipTests=true -B -V + mvn -Pstaging install -DskipTests=true -Dno-format -B -V - name: "Maven test" run: | mvn -Pstaging test -B diff --git a/.gitignore b/.gitignore index dccf579c8..58515ad74 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ spec/en/master-filtered.xml *.iws .idea *.swp +.cache diff --git a/ide-config/pom.xml b/ide-config/pom.xml new file mode 100644 index 000000000..1f1b19be1 --- /dev/null +++ b/ide-config/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + + jakarta.enterprise + jakarta.enterprise.cdi-parent + 4.1.0-SNAPSHOT + + + cdi-ide-config + + CDI IDE Config + Formatting config and import sorting + + + 11 + + + \ No newline at end of file diff --git a/ide-config/src/main/resources/cdi-format.xml b/ide-config/src/main/resources/cdi-format.xml new file mode 100644 index 000000000..abda5766a --- /dev/null +++ b/ide-config/src/main/resources/cdi-format.xml @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ide-config/src/main/resources/cdi.importorder b/ide-config/src/main/resources/cdi.importorder new file mode 100644 index 000000000..fa81c81b2 --- /dev/null +++ b/ide-config/src/main/resources/cdi.importorder @@ -0,0 +1,6 @@ +#Organize Import Order +0=java +1=javax +2=jakarta +3=org +4=com diff --git a/pom.xml b/pom.xml index f09700c8c..9f6a0e164 100644 --- a/pom.xml +++ b/pom.xml @@ -34,9 +34,46 @@ lang-model api el + ide-config clean package + + + + net.revelc.code.formatter + formatter-maven-plugin + ${formatter.version} + + + jakarta.enterprise + cdi-ide-config + ${project.version} + + + + + .cache/formatter-maven-plugin-${formatter-maven-plugin.version} + cdi-format.xml + LF + ${format.skip} + + + + net.revelc.code + impsort-maven-plugin + ${impsort.version} + + + .cache/impsort-maven-plugin-${impsort-maven-plugin.version} + java.,javax.,jakarta.,org.,com. + * + ${format.skip} + true + + + + @@ -48,6 +85,11 @@ 3.8.1 3.2.2 + + false + 2.23.0 + 1.9.0 + https://jakarta.oss.sonatype.org/ ${sonatypeOssDistMgmtNexusUrl}content/repositories/staging/ @@ -86,6 +128,97 @@ + + + format + + false + + !no-format + + + + + src/main/java + + + + + + net.revelc.code.formatter + formatter-maven-plugin + + + process-sources + + format + + + + + + net.revelc.code + impsort-maven-plugin + + + sort-imports + + sort + + + + + true + + + + + + + validate + + false + + no-format + + + + + src/main/java + + + + + + net.revelc.code.formatter + formatter-maven-plugin + + + process-sources + + validate + + + + + + net.revelc.code + impsort-maven-plugin + + true + + + + check-imports + + check + + + + + + +