Skip to content

Commit

Permalink
try excluding lombok generated methods from Jacoco test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaspayette committed Feb 4, 2025
1 parent 503b369 commit 6f4e4dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ tasks.jacocoTestReport {
}
}

tasks.jacocoTestCoverageVerification {
violationRules {
rule {
element = "METHOD"
excludes = listOf("lombok.Generated")
}
}
}

spotbugs {
excludeFilter.set(file("${rootProject.projectDir}/spotbugs_exclude.xml"))
}
2 changes: 2 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Suppress warnings for generated code; otherwise Spotbugs complains about lazy getters
# See: https://github.com/spotbugs/spotbugs/issues/3084
lombok.extern.findbugs.addSuppressFBWarnings = true
# Anotate generated methods to make it easier to exclude them from test coverage
lombok.addLombokGeneratedAnnotation = true

0 comments on commit 6f4e4dd

Please sign in to comment.