From de7b7c3b02b65c85c520f0266e49f4d7c4dc12d6 Mon Sep 17 00:00:00 2001 From: CybAtax <62847599+CybAtax@users.noreply.github.com> Date: Sun, 17 Nov 2024 18:20:09 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=8E=A8=20Add=20spotless=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc.yml | 7 +++++++ build.gradle.kts | 5 +++++ gradle/spotless.gradle | 14 ++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 .prettierrc.yml create mode 100644 gradle/spotless.gradle diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..3e42871 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,7 @@ +plugins: + - prettier-plugin-java +parser: java +printWidth: 120 +tabWidth: 4 +singleQuote: false +useTabs: false \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 22e30f7..68ae96d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,11 +2,16 @@ plugins { java id("org.springframework.boot") version "3.3.5" id("io.spring.dependency-management") version "1.1.6" + id("com.diffplug.spotless") version "6.25.0" } group = "io.github.markl4yg.hca" version = "0.0.1-SNAPSHOT" +apply( + from = file("./gradle/spotless.gradle") +) + java { toolchain { languageVersion = JavaLanguageVersion.of(21) diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle new file mode 100644 index 0000000..8d4d307 --- /dev/null +++ b/gradle/spotless.gradle @@ -0,0 +1,14 @@ +import java.nio.charset.StandardCharsets + +spotless { + enforceCheck(false) + ratchetFrom "origin/main" + + java { + target "src/**/java/**/*.java" + encoding(StandardCharsets.UTF_8) + removeUnusedImports() + prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.0']) + .configFile('.prettierrc.yml') + } +} \ No newline at end of file -- 2.45.3 From c658181da4742319de7970fc1cb9b2387846c538 Mon Sep 17 00:00:00 2001 From: CybAtax <62847599+CybAtax@users.noreply.github.com> Date: Sun, 17 Nov 2024 18:29:07 +0100 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=9A=A7=20Add=20formatting=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/formatting.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/formatting.yml diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml new file mode 100644 index 0000000..fc95b1f --- /dev/null +++ b/.github/workflows/formatting.yml @@ -0,0 +1,28 @@ +name: Check formatting + +on: + pull_request: + branches: + - main + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + check-formatting: + runs-on: linux + steps: + - uses: actions/checkout@v44 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - uses: gradle/actions/setup-gradle@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Run formatting check + run: ./gradlew spotlessCheck \ No newline at end of file -- 2.45.3 From 41a9e2bd99e8cdcf23692da8c58158d1961a1eed Mon Sep 17 00:00:00 2001 From: CybAtax <62847599+CybAtax@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:14:38 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=9A=A7=20Fix=20workflow=20label,=20Ad?= =?UTF-8?q?d=20build=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ .github/workflows/formatting.yml | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..15e9ed0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build gradle project + +on: + pull_request: + branches: + - main + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + check-formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v44 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + - uses: gradle/actions/setup-gradle@v4 + - name: Run formatting check + run: ./gradlew build \ No newline at end of file diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index fc95b1f..0100bac 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -11,7 +11,7 @@ concurrency: jobs: check-formatting: - runs-on: linux + runs-on: ubuntu-latest steps: - uses: actions/checkout@v44 with: @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: 17 + java-version: 21 - uses: gradle/actions/setup-gradle@v4 - uses: actions/setup-node@v4 with: -- 2.45.3 From eedd5e47bd10dae2427f37a879c139e8e52420b2 Mon Sep 17 00:00:00 2001 From: CybAtax <62847599+CybAtax@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:17:21 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Fix=20typos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- .github/workflows/formatting.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15e9ed0..109074f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: check-formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v44 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-java@v4 diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 0100bac..9160dbf 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -13,7 +13,7 @@ jobs: check-formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v44 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-java@v4 -- 2.45.3 From 36d34dc0856c9c91828c8b88d9979a6244d7d08d Mon Sep 17 00:00:00 2001 From: CybAtax <62847599+CybAtax@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:19:55 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=8F=83=20Make=20binaries=20~run~execu?= =?UTF-8?q?table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- gradlew | 0 gradlew.bat | 0 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 gradlew mode change 100644 => 100755 gradlew.bat diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 109074f..c0eae71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build gradle project +name: Build on: pull_request: @@ -10,7 +10,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} jobs: - check-formatting: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 -- 2.45.3 From 25a6eb96cff11870e590d343d22d2dddfe0bfd2b Mon Sep 17 00:00:00 2001 From: CybAtax <62847599+CybAtax@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:20:38 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=94=A7=20Fix=20step=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0eae71..9f420ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,5 +21,5 @@ jobs: distribution: 'temurin' java-version: 21 - uses: gradle/actions/setup-gradle@v4 - - name: Run formatting check + - name: Build gradle project run: ./gradlew build \ No newline at end of file -- 2.45.3