diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 410865801..e68298ec1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -14,3 +14,13 @@ Resolves # + +--- + +### Format Checks + + +> [!NOTE] +> Files in PRs are automatically checked for format violations with `mvn spotless:check`. + +If this PR contains files with format violations, run `mvn spotless:apply` to fix them. diff --git a/.github/workflows/maven-format-check.yml b/.github/workflows/maven-format-check.yml new file mode 100644 index 000000000..5a2b6bbb3 --- /dev/null +++ b/.github/workflows/maven-format-check.yml @@ -0,0 +1,24 @@ +name: Maven Format Check + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + 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 diff --git a/FUNDING_SPLITS.csv b/FUNDING_SPLITS.csv index 28f2af6c8..98cb7a361 100644 --- a/FUNDING_SPLITS.csv +++ b/FUNDING_SPLITS.csv @@ -1,21 +1,21 @@ ethereum_address,github_username,impact_percentage -0x5D388Ec24Cc2C0C77458338696aa63AFB706A7b1,nya-elimu,45.86 -0xd46Cc93E3eE6a4fb532D9B48E95be7eD8f8f1DA0,jo-elimu,39.06 -0x342FaeB14127A79735144bbdC772AbB6b1bBe343,coderabbitai,3.58 -0x3965d420cde24fe00f742cb31257ca90e04556a7,tomaszsmy,1.01 -0x819e4F5E912abb36c8f6c03790e7508e03cc37a3,UmenR,0.95 +0x5D388Ec24Cc2C0C77458338696aa63AFB706A7b1,nya-elimu,45.57 +0xd46Cc93E3eE6a4fb532D9B48E95be7eD8f8f1DA0,jo-elimu,39.21 +0x342FaeB14127A79735144bbdC772AbB6b1bBe343,coderabbitai,3.69 +0x3965d420cde24fe00f742cb31257ca90e04556a7,tomaszsmy,1.00 +0x819e4F5E912abb36c8f6c03790e7508e03cc37a3,UmenR,0.94 0x513DceE2929a6e0CD115fb65Ec926d6569d98aff,venkatesh2k3,0.82 0x5367a6d4F5991327Bb20466684790e394bE000dE,Shubham-Vishwakarma,0.64 +0x4709ebf314c6492d57f4c6d4f57357d5b2bb074e,vrudas,0.62 0x0000000000000000000000000000000000000000,aschworer,0.61 -0x4709ebf314c6492d57f4c6d4f57357d5b2bb074e,vrudas,0.59 -0x0000000000000000000000000000000000000000,SnehaHS65,0.50 -0x6321286F9B73f427C72e1f9F1bC6b3d25eF06605,hhio618,0.49 +0x0000000000000000000000000000000000000000,SnehaHS65,0.49 +0x6321286F9B73f427C72e1f9F1bC6b3d25eF06605,hhio618,0.48 0x0000000000000000000000000000000000000000,urosht,0.48 -0x78888390AA08D9A25f3BDB8A1B35351D7c7F8a12,Bender-22,0.39 0x0000000000000000000000000000000000000000,alexander-kuruvilla,0.40 +0x78888390AA08D9A25f3BDB8A1B35351D7c7F8a12,Bender-22,0.39 0x914dBEe36BcAb63B2D15fAED08839Be43797b421,watr-sheep,0.32 0x0000000000000000000000000000000000000000,eymaal,0.30 0x0000000000000000000000000000000000000000,jpatel3,0.29 0x38c19Bc91fC35f8bCAd07F177cC2F11098B1F3ff,vuriaval,0.29 0x0000000000000000000000000000000000000000,Keerthi4308,0.29 -0x0000000000000000000000000000000000000000,SamehNoukary,0.24 +0x22d83d2681c8F04877b60F907D8288f011b314F8,Souvik-Cyclic,0.26 diff --git a/pom.xml b/pom.xml index 535b1add2..61aedd748 100644 --- a/pom.xml +++ b/pom.xml @@ -4,19 +4,23 @@ ai.elimu webapp war - 2.4.33-SNAPSHOT + 2.4.35-SNAPSHOT - 17 + 17 UTF-8 - 2.0.73 - 5.6.15.Final - 10.0.22 - 5.3.18 - 5.6.2 - 3.1.2 + 2.0.73 + 5.6.15.Final + 10.0.22 + 5.3.18 + 5.6.2 + 3.1.2 + + webapp + http://localhost:8080/webapp + webapp-SNAPSHOT @@ -35,8 +39,8 @@ - org.apache.maven.plugins - maven-compiler-plugin + org.apache.maven.plugins + maven-compiler-plugin 3.11.0 ${java.version} @@ -57,7 +61,7 @@ org.apache.maven.plugins - maven-release-plugin + maven-release-plugin 3.1.1 @@ -91,6 +95,26 @@ + + com.diffplug.spotless + spotless-maven-plugin + 2.43.0 + + + + + **/*.java + **/*.jsp + **/*.xml + + + true + 4 + + + + + @@ -110,19 +134,7 @@ - - webapp - http://localhost:8080/webapp - - - GitHub - https://github.com/orgs/elimu-ai/projects?query=is%3Aopen - - - GitHub Actions - https://github.com/elimu-ai/webapp/actions - scm:git:git@github.com:elimu-ai/webapp.git scm:git:https://github.com/elimu-ai/webapp.git @@ -156,7 +168,7 @@ - org.apache.maven.plugins + org.apache.maven.plugins maven-surefire-plugin ${surefire-plugin.version} @@ -175,7 +187,7 @@ - org.apache.maven.plugins + org.apache.maven.plugins maven-surefire-plugin ${surefire-plugin.version} @@ -208,7 +220,7 @@ - org.apache.maven.plugins + org.apache.maven.plugins maven-surefire-plugin ${surefire-plugin.version} @@ -258,15 +270,15 @@ - org.apache.maven.plugins - maven-war-plugin + org.apache.maven.plugins + maven-war-plugin 3.4.0 ${basedir}/target/web.xml - org.apache.maven.plugins + org.apache.maven.plugins maven-surefire-plugin ${surefire-plugin.version} @@ -278,284 +290,277 @@ - - - com.github.elimu-ai - model - model-${model.version} - - - - org.pmml4s - pmml4s_3 - 1.0.1 - - - - commons-fileupload - commons-fileupload - - 1.4 - - - - - org.springframework - spring-aspects - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - org.springframework - spring-context-support - ${spring.version} - - - org.springframework - spring-orm - ${spring.version} - - - org.springframework - spring-oxm - ${spring.version} - - - org.springframework - spring-web - ${spring.version} - - - org.springframework - spring-webmvc - ${spring.version} - - - - - org.springframework.security - spring-security-web - ${spring.security.version} - - - org.springframework.security - spring-security-config - ${spring.security.version} - - - org.springframework.security - spring-security-taglibs - ${spring.security.version} - - - - com.github.scribejava - scribejava-apis - 8.3.3 - - - org.json - json - 20231013 - + + + + com.github.elimu-ai + model + model-${model.version} + - - org.apache.logging.log4j - log4j-api - 2.16.0 - - - org.apache.logging.log4j - log4j-core - 2.16.0 - - - org.apache.logging.log4j - log4j-web - 2.14.1 - + + + org.springframework + spring-aspects + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-context-support + ${spring.version} + + + org.springframework + spring-orm + ${spring.version} + + + org.springframework + spring-oxm + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + - - org.owasp.antisamy - antisamy - 1.7.6 - + + + org.springframework.security + spring-security-web + ${spring.security.version} + + + org.springframework.security + spring-security-config + ${spring.security.version} + + + org.springframework.security + spring-security-taglibs + ${spring.security.version} + - - org.apache.httpcomponents.client5 - httpclient5 - 5.3.1 - + + + org.apache.logging.log4j + log4j-api + 2.16.0 + + + org.apache.logging.log4j + log4j-core + 2.16.0 + + + org.apache.logging.log4j + log4j-web + 2.16.0 + - - org.web3j - core - 5.0.0 - + + + commons-fileupload + commons-fileupload + 1.4 + + + commons-lang + commons-lang + 2.6 + + + commons-io + commons-io + 2.16.1 + + + commons-validator + commons-validator + 1.9.0 + + + org.apache.commons + commons-csv + 1.9.0 + - - org.aspectj - aspectjweaver - 1.9.22.1 - + + + org.pmml4s + pmml4s_3 + 1.0.1 + - - javax.validation - validation-api - 2.0.1.Final - - - org.hibernate.validator - hibernate-validator - 6.1.7.Final - + + com.github.scribejava + scribejava-apis + 8.3.3 + + + org.json + json + 20231013 + + + org.owasp.antisamy + antisamy + 1.7.6 + - - commons-lang - commons-lang - 2.6 - - - commons-io - commons-io - 2.16.1 - - - commons-validator - commons-validator - 1.9.0 - - - org.apache.commons - commons-csv - 1.9.0 - + + org.apache.httpcomponents.client5 + httpclient5 + 5.3.1 + - - org.imgscalr - imgscalr-lib - 4.2 - + + org.web3j + core + 5.0.0 + - - com.googlecode.soundlibs - jlayer - 1.0.1.4 - - - junit - junit - - - + + org.aspectj + aspectjweaver + 1.9.22.1 + - - com.googlecode.soundlibs - tritonus-share - 0.3.7.4 - + + org.imgscalr + imgscalr-lib + 4.2 + - - com.googlecode.soundlibs - mp3spi - 1.9.5.4 - + + + com.googlecode.soundlibs + jlayer + 1.0.1.4 + + + com.googlecode.soundlibs + tritonus-share + 0.3.7.4 + + + com.googlecode.soundlibs + mp3spi + 1.9.5.4 + + + org.bitbucket.ijabz + jaudiotagger + 3.0.1 + - - com.googlecode.texhyphj - texhyphj - 1.2 - + + com.googlecode.texhyphj + texhyphj + 1.2 + - - net.dongliu - apk-parser - 2.6.10 - + + net.dongliu + apk-parser + 2.6.10 + - - org.hibernate - hibernate-core - ${hibernate.version} - - - org.hibernate - hibernate-entitymanager - ${hibernate.version} - - - org.hibernate - hibernate-tools - ${hibernate.version} - - - javax.persistence - javax.persistence-api - 2.2 - + + javax.servlet + jstl + 1.2 + - - javax.servlet - jstl - 1.2 - + + + org.hibernate + hibernate-core + ${hibernate.version} + + + org.hibernate + hibernate-entitymanager + ${hibernate.version} + + + org.hibernate + hibernate-tools + ${hibernate.version} + - - - org.bitbucket.ijabz - jaudiotagger - 3.0.1 - + + org.hibernate.validator + hibernate-validator + 6.1.7.Final + + + javax.validation + validation-api + 2.0.1.Final + - - - javax.transaction - jta - 1.1 - - - org.hsqldb - hsqldb - 2.7.3 - - - mysql - mysql-connector-java - 8.0.28 - - - commons-dbcp - commons-dbcp - 1.4 - + + + javax.persistence + javax.persistence-api + 2.2 + + + javax.transaction + jta + 1.1 + + + org.hsqldb + hsqldb + 2.7.3 + + + mysql + mysql-connector-java + 8.0.30 + + + commons-dbcp + commons-dbcp + 1.4 + - - - javax.servlet - javax.servlet-api - 4.0.1 - provided - - - javax.servlet.jsp - javax.servlet.jsp-api - 2.3.3 - provided - - - org.junit.jupiter - junit-jupiter - 5.10.3 - test - + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + javax.servlet.jsp + javax.servlet.jsp-api + 2.3.3 + provided + - + + + org.junit.jupiter + junit-jupiter + 5.10.3 + test + org.mockito mockito-core 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