PMT-3: Add CI with Linting
Some checks failed
Quality Check / Linting Check (push) Failing after 35s

This commit is contained in:
Dominik Säume 2024-09-13 00:23:47 +02:00
parent 47ddf4158a
commit f2fee24acf
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
5 changed files with 52 additions and 3 deletions

19
.gitea/workflows/qs.yml Normal file
View file

@ -0,0 +1,19 @@
name: "Quality Check"
on:
- push
- pull_request
jobs:
linting:
name: "Linting Check"
runs-on: "ubuntu-latest"
container:
image: "git.euph.dev/actions/runner-java-21:latest"
steps:
- name: "Checkout"
uses: "https://git.euph.dev/actions/checkout@v3"
- name: "Checkstyle Linting Main"
run: gradle checkstyleMain
- name: "Checkstyle Linting Test"
run: gradle checkstyleTest

View file

@ -6,11 +6,17 @@ repositories {
plugins { plugins {
java java
checkstyle
id("org.springframework.boot") version "3.3.3" id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6" id("io.spring.dependency-management") version "1.1.6"
id("org.hidetake.swagger.generator") version "2.19.2" id("org.hidetake.swagger.generator") version "2.19.2"
} }
checkstyle {
toolVersion = "10.12.4"
configFile = file("src/main/resources/checkstyle.xml")
}
group = "de.hmmh" group = "de.hmmh"
version = "0.0.1-SNAPSHOT" version = "0.0.1-SNAPSHOT"
@ -73,9 +79,14 @@ tasks {
named("compileJava").configure { named("compileJava").configure {
dependsOn(swaggerSources.getByName("pmt").code) dependsOn(swaggerSources.getByName("pmt").code)
} }
withType<Checkstyle> {
reports {
xml.required.set(true)
html.required.set(false)
}
}
} }
sourceSets { sourceSets {
main { main {
java.srcDir("${swaggerSources.getByName("pmt").code.outputDir}/src/main/java") java.srcDir("${swaggerSources.getByName("pmt").code.outputDir}/src/main/java")

View file

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd"
>
<module name="Checker">
<property name="severity" value="error"/>
<property name="tabWidth" value="4"/>
<module name="LineLength">
<property name="max" value="120"/>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="NewlineAtEndOfFile"/>
</module>