You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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).
In cli/, run mvn -Dtest=PycharmTest,IntellijTest,FileAccessImplTest,EclipseWorkspaceLockCheckerTest test
— all pass.
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)
Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →
QA retest:
This is just an internal refactoring so no explicit feature to test in end-to-end test. I tested some basic stuff with the latest nightly SNAPSHOT release on Windows and verified that System.out is only used in few places that have commented with checkstyle:ignore.
I found that we also have a groovy script full of System.out statements without annotations but I verified that our commit hook is only checking *.java and *.groovy currently does not have linting.
Therefore, I set QA approved label.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internalNothing to be added to CHANGELOG, only internal storyQA approvedLabel a PR that has been re-testet via nightly SNAPSHOT after merge and commented.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #2123
Internal enhancement (developers only) — preparation for the linting harness, scoped to the
System.out/System.errCheckstyle rule. Labelledinternal, so no CHANGELOG entry.Implemented changes:
checkstyle.xml: gave theSystem.out/System.errrule the idSystemOutand added twosuppression mechanisms so legitimate usages no longer block the build:
SuppressWithNearbyCommentFilter— inline, single-line: a trailing// checkstyle:ignore SystemOut - reasonon the offending line (limited to that line only).SuppressionSingleFilter— whole-file, scoped to thelogpackage (the logging implementationlegitimately writes to
System.out/System.err); only theSystemOutrule is suppressed there.AbstractIdeContext(log just failed, point tologfile),
GraalVmHelper(native-image bootstrap before logging),CompleteCommandlet(bashcompletion must reach stdout),
Ideasy(option parsing before logger init),OperatingSystem(static OS detection, no context).
UrlSecurityFilenow logs via the SLF4J/jline logger; removedleftover debug prints from
PycharmTest,IntellijTest,FileAccessImplTest.EclipseWorkspaceLockChecker(+ its test): adopted the exactjava.io.File→java.nio.file.Pathand
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
printStackTraceviolation inIdeLogExceptionDetails(a different rule), and three furtherSystem.outsites already handled by#2120 / to be addressed with their respective rules.
Testing instructions
cli/, runmvn checkstyle:check— theSystem.out/System.errsites listed above no longerproduce violations (the remaining
printStackTraceinIdeLogExceptionDetailsis a differentrule and out of scope).
cli/, runmvn -Dtest=PycharmTest,IntellijTest,FileAccessImplTest,EclipseWorkspaceLockCheckerTest test— all pass.
mvn clean test— build is green.Checklist for this PR
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)internal— labelledinternal, no CHANGELOG entry needed