Skip to content

Create initial linter for z390 java code - #806

Draft
abekornelis wants to merge 14 commits into
z390development:mainfrom
abekornelis:linter
Draft

Create initial linter for z390 java code#806
abekornelis wants to merge 14 commits into
z390development:mainfrom
abekornelis:linter

Conversation

@abekornelis

@abekornelis abekornelis commented May 15, 2026

Copy link
Copy Markdown
Collaborator

fixes #807
For now: only 1 check (for unused imports) and only in the local build on windows.
Making a comparable change to the bash/bldjar process is okay.
But we must make sure the build process on github remains unaffected until we resolve the errors reported ...

@abekornelis
abekornelis requested a review from jyganci May 15, 2026 13:26
@abekornelis abekornelis self-assigned this May 15, 2026
@abekornelis abekornelis added enhancement New feature or request component-tools Related to development tooling component-build Related to build, distribution and packaging Lang:Script labels May 15, 2026
@abekornelis
abekornelis marked this pull request as draft May 30, 2026 13:36

@Zaneham Zaneham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Abe, I've had a proper look at this one. The ruleset itself looks good. One thing that isn't inline anywhere because it's about what's missing rather than what's here, the linter only runs from bat/BLDJAR.BAT. CI builds on ubuntu-latest through bash/blddist and bash/bldjar, so nothing here ever fires on a PR. That means the cleanup in 895-898 can regress without anyone noticing, and contributors on Linux never see it at all. Should bash/bldjar get the same block, or would you rather it was its own CI job?

Comment thread bat/BLDJAR.BAT
Comment on lines +42 to +43
java -jar build\checkstyle\checkstyle-all.jar -c src\checkstyle.xml src
if %ERRORLEVEL% NEQ 0 goto return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs over the whole src tree before javac, so merging this on its own stops the Windows build dead. I ran checkstyle 13.9.0 with your config over src at this head and got 108,938 violations across 20 files, mostly pz390, mz390, az390 and sz390. Even once 895-898 are in, about 93,000 are left.

So either this goes last, or the gate wants to be warn-only for now. A suppression file listing the not-yet-clean modules would let it be a real gate from day one and shrink as you work through them.

Comment thread bat/GetCheckStyle.PS1
$ProgressPreference = 'SilentlyContinue'

# Request latest release information
$apiUrl = 'https://api.github.com/repos/checkstyle/checkstyle/releases/latest'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

releases/latest means whoever builds gets whatever happened to be current when they first ran it, and a new checkstyle release can fail the build with no code change. Latest is already 13.9.0 against the 13.4.2 in your comment above. You write version.txt on line 30 but nothing ever reads it, so pinning a version and comparing against that file would fix both at once.

Comment thread bat/GetCheckStyle.PS1
Write-Progress -Activity "Download" -Completed
Write-Host "Download failed: $($_.Exception.Message)" -ForegroundColor Red
exit 1
} No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No trailing newline on this one.

@abekornelis

Copy link
Copy Markdown
Collaborator Author

Hi @Zaneham, You are correct - this is still a work in progress. It started out as a minimal thingy, just to prove feasibility. Then got out of control more or less. So, yes, the plan is indeed to fix all the java programs before merging this change. And an update to the bash build script definitely will have to be part of that merge. That's the whole point of having a linter to begin with.

@abekornelis abekornelis changed the title Create minimal linter Create initial linter for z390 java code Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component-build Related to build, distribution and packaging component-tools Related to development tooling enhancement New feature or request Lang:Script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add minimal linter stub to build process

2 participants