diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da17c84d..8046df39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: run: npm version from-git --no-git-tag-version --prefix docs - name: Test dRAGon - run: gradle npmInstall npmLint test + run: gradle criticalLintGradle checkstyleMain npmInstall npmLint test - name: Build Documentation run: npm install --prefix docs && npm run build --prefix docs diff --git a/backend/build.gradle b/backend/build.gradle index d0e28f91..c5160a61 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -1,9 +1,11 @@ plugins { id 'java' + id 'java-library' + id 'checkstyle' id 'application' id 'org.springframework.boot' version '3.2.5' id 'io.spring.dependency-management' version '1.1.4' - id "org.springdoc.openapi-gradle-plugin" version "1.8.0" + id 'org.springdoc.openapi-gradle-plugin' version '1.8.0' } group = 'ai' @@ -54,6 +56,13 @@ openApi { } } +checkstyle { + toolVersion '10.16.0' + config = rootProject.resources.text.fromFile('backend/checkstyle.xml') + ignoreFailures = false + maxWarnings = 0 +} + bootJar { manifest { attributes( diff --git a/backend/checkstyle.xml b/backend/checkstyle.xml new file mode 100644 index 00000000..7ed854da --- /dev/null +++ b/backend/checkstyle.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backend/src/main/java/ai/dragon/DragonApplication.java b/backend/src/main/java/ai/dragon/DragonApplication.java index 3a8c467e..8b98598c 100644 --- a/backend/src/main/java/ai/dragon/DragonApplication.java +++ b/backend/src/main/java/ai/dragon/DragonApplication.java @@ -5,7 +5,7 @@ @SpringBootApplication public class DragonApplication { - public static void main(String[] args) { - SpringApplication.run(DragonApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(DragonApplication.class, args); + } } diff --git a/backend/src/main/java/ai/dragon/component/DirectoryStructureComponent.java b/backend/src/main/java/ai/dragon/component/DirectoryStructureComponent.java index ca861b74..3103406f 100644 --- a/backend/src/main/java/ai/dragon/component/DirectoryStructureComponent.java +++ b/backend/src/main/java/ai/dragon/component/DirectoryStructureComponent.java @@ -71,4 +71,4 @@ private void createDatabaseDirectory() { logger.debug("Database directory already exists : " + databaseDirectory); } } -} \ No newline at end of file +} diff --git a/backend/src/main/java/ai/dragon/entity/ProviderEntity.java b/backend/src/main/java/ai/dragon/entity/ProviderEntity.java index c03f216a..ec95f4e2 100644 --- a/backend/src/main/java/ai/dragon/entity/ProviderEntity.java +++ b/backend/src/main/java/ai/dragon/entity/ProviderEntity.java @@ -32,7 +32,9 @@ public class ProviderEntity implements IAbstractEntity { @Schema(description = "Type of the Provider") private ProviderType type; - @Schema(description = "Headers to be sent to the Provider (if applicable) in the form of key-value pairs. Could be used for authentication with API keys, tokens, etc.") + @Schema(description = """ + Headers to be sent to the Provider (if applicable) in the form of key-value pairs. + Could be used for authentication with API keys, tokens, etc.""") private Map httpHeaders; public ProviderEntity() {