Skip to content

Commit

Permalink
DROP: testing file
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs committed Sep 25, 2024
1 parent f007ee9 commit 7908dc0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/code_quality_check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code Convention Verification
name: Code Quality Check

on:
push:
Expand All @@ -14,7 +14,18 @@ jobs:
checkstyle-and-spotless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # Checkout the branch of the pull request
fetch-depth: 0

- name: List Changed Files
run: |
echo "Current branch: ${{ github.head_ref }}"
echo "Changed files:"
git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }}
- name: Setup Java & Gradle
uses: actions/setup-java@v4
Expand All @@ -38,8 +49,8 @@ jobs:
- name: Run Checkstyle
run: |
./gradlew clean rskj-core:checkstyleMain checkstyleTest
./gradlew clean rskj-core:checkstyleMain checkstyleTest --info
- name: Run Spotless Check
run: |
./gradlew clean rskj-core:spotlessCheck
./gradlew clean rskj-core:spotlessCheck --info
22 changes: 20 additions & 2 deletions rskj-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ def getFilteredFiles() {
def uncommittedFiles = outputDiff.toString().trim().split('\n').toList().unique()
def stagedFiles = outputStaged.toString().trim().split('\n').toList().unique()
def allFiles = committedFiles + uncommittedFiles + stagedFiles

println("Committed files: ${committedFiles}")
println("Uncommitted files: ${uncommittedFiles}")
println("Staged files: ${stagedFiles}")


allFiles = allFiles.unique().findAll { file -> file }

allFiles = allFiles.findAll { file ->
Expand All @@ -85,10 +91,20 @@ def configureCheckstyleTask(Checkstyle task, File sourceDir) {
def files = getFilteredFiles()
def filteredFilesCheckstyle = files.findAll { file ->
def filePath = file.toPath().normalize()
def isUnderSourceDir = filePath.startsWith(sourceDirPath) && !filePath.equals(sourceDirPath)
def relativePath = sourceDirPath.relativize(filePath).toString()
def isUnderSourceDir = relativePath.startsWith("") && !relativePath.equals("")

println "Checking file: ${file.absolutePath}"
println "Relative path: ${relativePath}, Under source dir: ${isUnderSourceDir}"

isUnderSourceDir
}

println "Filtered Checkstyle files: ${filteredFilesCheckstyle.collect { it.absolutePath }}"

task.source = project.files(filteredFilesCheckstyle)
println "Task source set to: ${task.source.files.collect { it.absolutePath }}"

task.classpath = project.files(
sourceSets.main.output.classesDirs,
sourceSets.main.output.resourcesDir
Expand All @@ -98,7 +114,9 @@ def configureCheckstyleTask(Checkstyle task, File sourceDir) {
html.required.set(true)
}
task.onlyIf {
!filteredFilesCheckstyle.isEmpty()
def hasFiles = !filteredFilesCheckstyle.isEmpty()
println "Checkstyle task only if: $hasFiles"
hasFiles
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class GarbageCollectorConfig {
private final int blocksPerEpoch;
private final int numberOfEpochs;


//asdasdasdsdsd

public GarbageCollectorConfig(boolean enabled, int blocksPerEpoch, int numberOfEpochs) {
this.enabled = enabled;
this.blocksPerEpoch = blocksPerEpoch;
Expand Down

0 comments on commit 7908dc0

Please sign in to comment.