Skip to content

#2123: configure Checkstyle suppression for legitimate System.out usages#2128

Open
maybeec wants to merge 2 commits into
devonfw:mainfrom
maybeec:feature/2123-checkstyle-system-out-suppression
Open

#2123: configure Checkstyle suppression for legitimate System.out usages#2128
maybeec wants to merge 2 commits into
devonfw:mainfrom
maybeec:feature/2123-checkstyle-system-out-suppression

Conversation

@maybeec

@maybeec maybeec commented Jul 7, 2026

Copy link
Copy Markdown
Member

This PR fixes #2123

Internal enhancement (developers only) — preparation for the linting harness, scoped to the
System.out / System.err Checkstyle rule. Labelled internal, so no CHANGELOG entry.

Implemented changes:

  • checkstyle.xml: gave the System.out/System.err rule the id SystemOut and added two
    suppression mechanisms so legitimate usages no longer block the build:
    • SuppressWithNearbyCommentFilter — inline, single-line: a trailing // checkstyle:ignore SystemOut - reason on the offending line (limited to that line only).
    • SuppressionSingleFilter — whole-file, scoped to the log package (the logging implementation
      legitimately writes to System.out/System.err); only the SystemOut rule is suppressed there.
  • Marked the legitimate usages with inline markers: AbstractIdeContext (log just failed, point to
    logfile), GraalVmHelper (native-image bootstrap before logging), CompleteCommandlet (bash
    completion must reach stdout), Ideasy (option parsing before logger init), OperatingSystem
    (static OS detection, no context).
  • Cleaned up the accidental usages: UrlSecurityFile now logs via the SLF4J/jline logger; removed
    leftover debug prints from PycharmTest, IntellijTest, FileAccessImplTest.
  • EclipseWorkspaceLockChecker (+ its test): adopted the exact java.io.Filejava.nio.file.Path
    and System.out → SLF4J-logger change from #2118: replace java.io.File usages with java.nio.file.Path #2120 so both branches merge without conflict.

Out of scope and intentionally left as-is: the printStackTrace violation in
IdeLogExceptionDetails (a different rule), and three further System.out sites already handled by
#2120 / to be addressed with their respective rules.

Testing instructions

  1. In cli/, run mvn checkstyle:check — the System.out/System.err sites listed above no longer
    produce violations (the remaining printStackTrace in IdeLogExceptionDetails is a different
    rule and out of scope).
  2. In cli/, run mvn -Dtest=PycharmTest,IntellijTest,FileAccessImplTest,EclipseWorkspaceLockCheckerTest test
    — all pass.
  3. Run mvn clean test — build is green.

Checklist for this PR

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled with internallabelled internal, no CHANGELOG entry needed
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 7, 2026
@maybeec maybeec added the internal Nothing to be added to CHANGELOG, only internal story label Jul 7, 2026
@maybeec maybeec requested a review from hohwille July 7, 2026 13:21
@coveralls

coveralls commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28893927583

Coverage decreased (-0.03%) to 72.095%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 78 coverage regressions across 6 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

78 previously-covered lines in 6 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/context/AbstractIdeContext.java 45 67.95%
com/devonfw/tools/ide/url/model/file/UrlSecurityFile.java 19 11.11%
com/devonfw/tools/ide/locking/EclipseWorkspaceLockChecker.java 8 39.29%
com/devonfw/tools/ide/cli/GraalVmHelper.java 4 0.0%
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.33%
com/devonfw/tools/ide/version/VersionSegment.java 1 91.08%

Coverage Stats

Coverage Status
Relevant Lines: 16708
Covered Lines: 12554
Line Coverage: 75.14%
Relevant Branches: 7456
Covered Branches: 4867
Branch Coverage: 65.28%
Branches in Coverage %: Yes
Coverage Strength: 3.18 hits per line

💛 - Coveralls

@maybeec maybeec moved this from 🆕 New to Team Review in IDEasy board Jul 7, 2026
@maybeec maybeec added this to the release:2026.07.002 milestone Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Nothing to be added to CHANGELOG, only internal story

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Add linting harness to ensure code-quality

2 participants