Skip to content

Commit 6871344

Browse files
committed
Removed checkstyle and PMD configurations
1 parent 6adde1b commit 6871344

File tree

5 files changed

+9
-526
lines changed

5 files changed

+9
-526
lines changed

.github/workflows/gradle.yml

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -90,71 +90,18 @@ jobs:
9090
runs-on: ubuntu-latest
9191

9292
steps:
93-
- uses: actions/checkout@v3
93+
- uses: actions/checkout@v4
94+
with:
95+
fetch-depth: 0
9496
- name: Set up JDK 17
95-
uses: actions/setup-java@v3
97+
uses: actions/setup-java@v4
9698
with:
9799
java-version: 17
98100
distribution: 'temurin'
99101
cache: gradle
100-
- uses: actions/cache@v3
102+
- name: Qodana - Code Quality
103+
uses: JetBrains/[email protected]
101104
with:
102-
path: |
103-
~/.gradle/caches
104-
~/.gradle/wrapper
105-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
106-
restore-keys: |
107-
${{ runner.os }}-gradle-
108-
- name: Gradle wrapper
109-
run: gradle wrapper
110-
- name: Grant execute permission for gradlew
111-
run: chmod +x gradlew
112-
- id: file_changes
113-
uses: trilom/[email protected]
114-
- name: Filter Java Files
115-
id: filter_java_files
116-
run: |
117-
# Get modified and added files
118-
MODIFIED_FILES=${{ steps.file_changes.outputs.files_modified }}
119-
ADDED_FILES=${{ steps.file_changes.outputs.files_added }}
120-
121-
echo "Modified files: $MODIFIED_FILES"
122-
echo "Added files: $ADDED_FILES"
123-
124-
# Simple approach using shell commands to filter Java files
125-
# Remove brackets and quotes from the JSON arrays
126-
MODIFIED_FILES=$(echo "$MODIFIED_FILES" | sed 's/^\[//;s/\]$//;s/"//g;s/,/ /g')
127-
ADDED_FILES=$(echo "$ADDED_FILES" | sed 's/^\[//;s/\]$//;s/"//g;s/,/ /g')
128-
129-
# Combine the files and filter for .java files
130-
ALL_FILES="$MODIFIED_FILES $ADDED_FILES"
131-
JAVA_FILES=""
132-
133-
# If there are files to process
134-
if [ ! -z "$ALL_FILES" ]; then
135-
# Filter for Java files and format as JSON array
136-
for file in $ALL_FILES; do
137-
if [[ "$file" == *.java ]]; then
138-
if [ -z "$JAVA_FILES" ]; then
139-
JAVA_FILES="\"$file\""
140-
else
141-
JAVA_FILES="$JAVA_FILES,\"$file\""
142-
fi
143-
fi
144-
done
145-
fi
146-
147-
# Create a proper JSON array
148-
JAVA_FILES="[$JAVA_FILES]"
149-
150-
echo "JAVA_FILES=$JAVA_FILES" >> $GITHUB_ENV
151-
echo "Filtered Java Files: $JAVA_FILES"
152-
- name: Run Code Style Check
153-
run: ./gradlew checkstyleCI --no-daemon
154-
env:
155-
MODIFIED_FILES: ${{ env.JAVA_FILES }}
156-
ACTIONS_STEP_DEBUG: true
157-
- name: Run PMD Quality Check
158-
run: ./gradlew pmdCI --no-daemon
159-
env:
160-
MODIFIED_FILES: ${{ env.JAVA_FILES }}
105+
cache-default-branch-only: true
106+
use-caches: 'gradle'
107+
args: '--baseline,qodana.sarif.json'

build.gradle.kts

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
import groovy.json.JsonSlurper
76
import org.jetbrains.changelog.Changelog
87
import org.jetbrains.changelog.markdownToHTML
98
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
109

1110
plugins {
1211
id("java")
13-
id("checkstyle")
14-
id("pmd")
1512
alias(libs.plugins.kotlin)
1613
alias(libs.plugins.intelliJPlatform)
1714
alias(libs.plugins.changelog)
@@ -150,19 +147,7 @@ tasks {
150147
useJUnitPlatform()
151148
}
152149

153-
checkstyle {
154-
toolVersion = "8.31"
155-
isIgnoreFailures = false
156-
maxWarnings = 0
157-
configFile = rootProject.file("${rootDir}/gradle-tasks/checkstyle/checkstyle.xml")
158-
}
159150

160-
pmd {
161-
toolVersion = "6.21.0"
162-
isConsoleOutput = true
163-
ruleSetFiles = files("${rootDir}/gradle-tasks/pmd/ruleset.xml")
164-
ruleSets = listOf()
165-
}
166151
}
167152

168153
intellijPlatformTesting {
@@ -188,68 +173,12 @@ intellijPlatformTesting {
188173
}
189174
}
190175

191-
// Configure Checkstyle tasks
192-
tasks.withType(Checkstyle::class).configureEach {
193-
// Specify all files that should be checked
194-
classpath = files()
195-
setSource("${project.rootDir}")
196-
}
197-
198-
// Execute Checkstyle on all files
199-
tasks.register<Checkstyle>("checkstyle") {
200-
// Task-specific configuration can go here if necessary
201-
}
202-
203-
// Execute Checkstyle on all modified files
204-
tasks.register<Checkstyle>("checkstyleCI") {
205-
val changedFiles = getChangedFiles()
206-
include(changedFiles)
207-
}
208-
209-
// Configure PMD tasks
210-
tasks.withType(Pmd::class).configureEach {
211-
// Specify all files that should be checked
212-
classpath = files()
213-
setSource("${project.rootDir}")
214-
}
215-
216-
// Execute PMD on all files
217-
tasks.register<Pmd>("pmd") {
218-
// Task-specific configuration can go here if necessary
219-
}
220176

221-
// Execute PMD on all modified files
222-
tasks.register<Pmd>("pmdCI") {
223-
val changedFiles = getChangedFiles()
224-
include(changedFiles)
225-
}
226177

227-
/**
228-
* Get all files that are changed but not deleted nor renamed.
229-
* Compares to master or the specified target branch.
230-
*
231-
* @return list of all changed files
232-
*/
233-
fun getChangedFiles(): List<String> {
234-
val modifiedFilesJson = System.getenv("MODIFIED_FILES")
235-
val files = mutableListOf<String>()
236178

237-
if (modifiedFilesJson == null) {
238-
return files
239-
}
240-
241-
println("Modified Files: $modifiedFilesJson")
242179

243-
// Parse the JSON string into a list of files
244-
val modifiedFiles = JsonSlurper().parseText(modifiedFilesJson) as List<*>
245180

246-
modifiedFiles.forEach {
247-
files.add(it.toString())
248-
}
249181

250-
// Return the list of touched files
251-
return files
252-
}
253182

254183
kover {
255184
currentProject {

check_modified.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)