diff --git a/.github/workflows/jacoco_check.yml b/.github/workflows/jacoco_check.yml index 2e15a31..0a0a562 100644 --- a/.github/workflows/jacoco_check.yml +++ b/.github/workflows/jacoco_check.yml @@ -36,6 +36,8 @@ jobs: scalaShort: "2.12" overall: 80.0 changed: 80.0 + per-changed-file: 60.0 + steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd @@ -49,18 +51,23 @@ jobs: with: java-version: "adopt@1.11" + - name: Setup Python + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + with: + python-version: "3.14" + - name: Build and run tests run: sbt ++${{matrix.scala}} jacoco - name: Add JaCoCo Report in PR comments id: jacoco - uses: MoranaApps/jacoco-report@54bfe284d1119dc917dddba80517c54c5bcf3627 + uses: MoranaApps/jacoco-report@3be109b40946547c5925e63d41fef1099c9e562b with: paths: | **/jacoco.xml token: ${{ secrets.GITHUB_TOKEN }} - min-coverage-overall: ${{ matrix.overall }} - min-coverage-changed-files: ${{ matrix.changed }} + global-thresholds: '${{ matrix.overall }}*${{ matrix.changed }}' + report-thresholds-default: '${{ matrix.overall }}*${{ matrix.changed }}*${{ matrix.per-changed-file }}' title: JaCoCo code coverage report - scala ${{ matrix.scala }} update-comment: true diff --git a/build.sbt b/build.sbt index e57db7d..d9b5374 100644 --- a/build.sbt +++ b/build.sbt @@ -66,12 +66,9 @@ Global / excludeLintKeys += ThisBuild / name // will be used in publish, todo #3 // JaCoCo Method Filter Plugin enablePlugins(JacocoFilterPlugin) - jacocoReportName := s"spark-data-standardization Jacoco Report - scala:${scalaVersion.value}" jacocoReportFormats := Set("html", "xml") - // jacocoExcludes := Seq("za/co/absa/standardization/udf/UDFBuilder*", "za/co/absa/standardization/udf/UDFNames") - // Command aliases for JaCoCo coverage workflow addCommandAlias("jacoco", "; jacocoOn; clean; test; jacocoReportAll; jacocoOff") addCommandAlias("jacocoOn", "; set every jacocoPluginEnabled := true") diff --git a/jmf-rules.txt b/jmf-rules.txt index 7c2ade2..3ce6764 100644 --- a/jmf-rules.txt +++ b/jmf-rules.txt @@ -1,118 +1,25 @@ -# jacoco-method-filter — Default Rules & HowTo (Scala) -# [jmf:1.0.0] +# jacoco-method-filter — Rules Template AbsaOSS/spark-data-standardization +# [jmf:2.2.0] # -# This file defines which methods should be annotated as *Generated so JaCoCo ignores them. -# One rule per line. +# Syntax reference, pitfalls, examples, and workflows: https://github.com/MoranaApps/jacoco-method-filter/blob/main/docs/rules-reference.md # # ───────────────────────────────────────────────────────────────────────────── -# HOW TO USE (quick) -# 1) Replace YOUR.PACKAGE.ROOT with your project’s package root (e.g., com.example.app). -# 2) Start with the CONSERVATIVE section only. -# 3) If clean, enable STANDARD. Use AGGRESSIVE only inside DTO/auto‑generated packages. -# 4) Keep rules narrow (by package), prefer flags (synthetic/bridge) for compiler artifacts, -# and add `id:` labels so logs are easy to read. -# +# HOW TO USE # ───────────────────────────────────────────────────────────────────────────── -# ALLOWED SYNTAX (cheat sheet) -# -# General form: -# #() [FLAGS and PREDICATES...] -# -# FQCN_glob (dot form; $ allowed for inner classes): -# Examples: *.model.*, com.example.*, * -# -# method_glob (glob on method name): -# Examples: copy | $anonfun$* | get* | *_$eq -# -# descriptor_glob (JVM descriptor in (args)ret). You may omit it entirely. -# • Omitting descriptor ⇒ treated as "(*)*" (any args, any return). -# • Short/empty forms "", "()", "(*)" normalize to "(*)*". -# Examples: -# (I)I # takes int, returns int -# (Ljava/lang/String;)V # takes String, returns void -# () or (*) or omitted # any args, any return -# -# FLAGS (optional) — space or comma separated: -# public | protected | private | synthetic | bridge | static | abstract -# -# PREDICATES (optional): -# ret: # match return type only (e.g., ret:V, ret:I, ret:Lcom/example/*;) -# id: # identifier shown in logs/reports -# name-contains: # method name must contain -# name-starts: # method name must start with -# name-ends: # method name must end with # -# Notes -# - Always use dot-form (com.example.Foo) for class names. -# - Comments (# …) and blank lines are ignored. +# 1) Review the GLOBAL RULES below — they cover compiler-generated boilerplate. +# 2) Add project-specific patterns in the PROJECT RULES section. +# 3) Keep rules narrow; add id: labels so logs are readable. +# Every rule must have an id: