From 2165de6a9ee7e3ce709f0df580b9ce31f44bef65 Mon Sep 17 00:00:00 2001 From: jo-elimu <1451036+jo-elimu@users.noreply.github.com> Date: Sun, 14 Jul 2024 12:08:57 +0700 Subject: [PATCH 01/29] build(mvn): spotless maven plugin closes #1728 --- .github/workflows/maven-build.yml | 1 + pom.xml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 5275669a7..14f76fc9a 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -29,3 +29,4 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} verbose: true + - run: mvn spotless:check diff --git a/pom.xml b/pom.xml index a9e9e4266..01343260b 100644 --- a/pom.xml +++ b/pom.xml @@ -106,6 +106,25 @@ + + com.diffplug.spotless + spotless-maven-plugin + 2.43.0 + + + + + src/main/java/**.*. + src/test/java/**.*. + + + true + 4 + + + + + From 65e9b09ad5c9bad3152be3d9db2391f01833bcfc Mon Sep 17 00:00:00 2001 From: jo-elimu <1451036+jo-elimu@users.noreply.github.com> Date: Sun, 14 Jul 2024 12:17:12 +0700 Subject: [PATCH 02/29] build(mvn): src/main/java/**/*.java refs #1728 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 01343260b..0d13ab114 100644 --- a/pom.xml +++ b/pom.xml @@ -114,8 +114,8 @@ - src/main/java/**.*. - src/test/java/**.*. + src/main/java/**/*.java + src/test/java/**/*.java true From 41e3bcc0e5670f1c0df2d1482de0f14fcea1f9a7 Mon Sep 17 00:00:00 2001 From: jo-elimu <1451036+jo-elimu@users.noreply.github.com> Date: Sun, 14 Jul 2024 12:28:25 +0700 Subject: [PATCH 03/29] build(mvn): add code format check to separate job refs #1728 --- .github/workflows/maven-build.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 14f76fc9a..e1c9ac1ab 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -1,4 +1,4 @@ -name: Maven Build +name: Maven Build & Code Format Check on: push: @@ -29,4 +29,20 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} verbose: true + + code_format_check: + needs: build + strategy: + matrix: + os: [ubuntu-latest] + java: [17] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: maven + - run: mvn clean - run: mvn spotless:check From b029157554531531f6f6cc39c866cd5a59fda8d0 Mon Sep 17 00:00:00 2001 From: jo-elimu <1451036+jo-elimu@users.noreply.github.com> Date: Sun, 14 Jul 2024 12:33:13 +0700 Subject: [PATCH 04/29] build(mvn): mvn spotless:apply refs #1728 --- .github/workflows/maven-build.yml | 2 +- src/main/java/ai/elimu/dao/AudioDao.java | 2 +- src/main/java/ai/elimu/dao/ContributorDao.java | 2 +- src/main/java/ai/elimu/dao/DbMigrationDao.java | 2 +- src/main/java/ai/elimu/dao/DeviceDao.java | 2 +- src/main/java/ai/elimu/dao/ImageDao.java | 2 +- src/main/java/ai/elimu/dao/NumberDao.java | 2 +- src/main/java/ai/elimu/dao/SoundDao.java | 2 +- .../java/ai/elimu/dao/StoryBookChapterDao.java | 2 +- src/main/java/ai/elimu/dao/StoryBookDao.java | 2 +- .../java/ai/elimu/dao/StoryBookParagraphDao.java | 2 +- src/main/java/ai/elimu/dao/VideoDao.java | 2 +- src/main/java/ai/elimu/dao/WordDao.java | 2 +- src/main/java/ai/elimu/dao/jpa/GenericDaoJpa.java | 2 +- .../java/ai/elimu/util/LetterFrequencyHelper.java | 2 +- .../ai/elimu/util/SyllableFrequencyHelper.java | 2 +- .../java/ai/elimu/util/WordFrequencyHelper.java | 2 +- .../ai/elimu/web/CustomAuthenticationManager.java | 2 +- src/main/java/ai/elimu/web/SignOnController.java | 6 +++--- .../java/ai/elimu/web/SignOnControllerDiscord.java | 2 +- .../java/ai/elimu/web/SignOnControllerGitHub.java | 2 +- .../ai/elimu/web/SignOnControllerSelenium.java | 4 ++-- .../java/ai/elimu/web/SignOnControllerWeb3.java | 2 +- src/main/java/ai/elimu/web/WelcomeController.java | 4 ++-- .../ai/elimu/web/admin/MainAdminController.java | 4 ++-- .../application/ApplicationCreateController.java | 4 ++-- .../application/ApplicationEditController.java | 4 ++-- .../application/ApplicationListController.java | 2 +- .../ApplicationVersionCreateController.java | 8 ++++---- .../LetterLearningEventListController.java | 2 +- .../web/analytics/MainAnalyticsController.java | 4 ++-- .../StoryBookLearningEventListController.java | 2 +- .../analytics/WordLearningEventListController.java | 2 +- .../elimu/web/content/MainContentController.java | 4 ++-- .../content/contributor/AddEmailController.java | 8 ++++---- .../content/contributor/ContributorController.java | 2 +- .../contributor/ContributorListController.java | 2 +- .../contributor/EditMotivationController.java | 4 ++-- .../content/contributor/EditNameController.java | 6 +++--- .../web/content/emoji/EmojiCreateController.java | 4 ++-- .../web/content/emoji/EmojiEditController.java | 8 ++++---- .../web/content/emoji/EmojiListController.java | 2 +- .../web/content/letter/LetterCreateController.java | 4 ++-- .../web/content/letter/LetterEditController.java | 4 ++-- .../web/content/letter/LetterListController.java | 2 +- .../letter_sound/LetterSoundCreateController.java | 4 ++-- .../letter_sound/LetterSoundEditController.java | 4 ++-- .../letter_sound/LetterSoundListController.java | 2 +- .../multimedia/audio/AudioCreateController.java | 8 ++++---- .../multimedia/audio/AudioEditController.java | 12 ++++++------ .../multimedia/audio/AudioListController.java | 2 +- .../multimedia/image/ImageCreateController.java | 8 ++++---- .../multimedia/image/ImageDeleteController.java | 2 +- .../multimedia/image/ImageEditController.java | 12 ++++++------ .../multimedia/image/ImageListController.java | 2 +- .../multimedia/video/VideoCreateController.java | 8 ++++---- .../multimedia/video/VideoEditController.java | 12 ++++++------ .../multimedia/video/VideoListController.java | 2 +- .../web/content/number/NumberCreateController.java | 4 ++-- .../web/content/number/NumberDeleteController.java | 2 +- .../web/content/number/NumberEditController.java | 4 ++-- .../web/content/number/NumberListController.java | 2 +- .../AudioPeerReviewEventCreateController.java | 2 +- ...LetterSoundPeerReviewEventCreateController.java | 2 +- .../NumberPeerReviewEventCreateController.java | 2 +- .../StoryBookPeerReviewEventCreateController.java | 2 +- .../WordPeerReviewEventCreateController.java | 2 +- .../web/content/sound/SoundCreateController.java | 4 ++-- .../web/content/sound/SoundEditController.java | 4 ++-- .../web/content/sound/SoundListController.java | 2 +- .../storybook/StoryBookCreateController.java | 4 ++-- .../StoryBookCreateFromEPubController.java | 8 ++++---- .../content/storybook/StoryBookEditController.java | 4 ++-- .../content/storybook/StoryBookListController.java | 2 +- .../chapter/StoryBookChapterCreateController.java | 4 ++-- .../chapter/StoryBookChapterDeleteController.java | 2 +- .../StoryBookParagraphCreateController.java | 4 ++-- .../StoryBookParagraphDeleteController.java | 2 +- .../StoryBookParagraphEditController.java | 4 ++-- .../content/syllable/SyllableListController.java | 2 +- .../web/content/word/WordCreateController.java | 4 ++-- .../word/WordCreationsPendingController.java | 2 +- .../elimu/web/content/word/WordEditController.java | 4 ++-- .../elimu/web/content/word/WordListController.java | 2 +- .../context/EnvironmentContextLoaderListener.java | 14 +++++++------- .../MostRecentContributionsController.java | 2 +- .../elimu/web/servlet/CustomDispatcherServlet.java | 4 ++-- src/test/java/ai/elimu/dao/BaseDaoTest.java | 2 +- src/test/java/ai/elimu/dao/ContributorDaoTest.java | 2 +- src/test/java/ai/elimu/dao/ImageDaoTest.java | 2 +- src/test/java/selenium/web/WelcomePageTest.java | 4 ++-- 91 files changed, 163 insertions(+), 163 deletions(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index e1c9ac1ab..06da4d378 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -1,4 +1,4 @@ -name: Maven Build & Code Format Check +name: Maven Build on: push: diff --git a/src/main/java/ai/elimu/dao/AudioDao.java b/src/main/java/ai/elimu/dao/AudioDao.java index d3dc5494b..8d732ad61 100644 --- a/src/main/java/ai/elimu/dao/AudioDao.java +++ b/src/main/java/ai/elimu/dao/AudioDao.java @@ -8,7 +8,7 @@ import org.springframework.dao.DataAccessException; public interface AudioDao extends GenericDao