Skip to content

[Java] Run Azure SDK lint rules on generated test clients - #12756

Open
Weidong Xu (weidongxu-microsoft) wants to merge 2 commits into
microsoft:mainfrom
weidongxu-microsoft:eng/java-azure-generated-code-lint
Open

Weidong Xu (weidongxu-microsoft) wants to merge 2 commits into
microsoft:mainfrom
weidongxu-microsoft:eng/java-azure-generated-code-lint

Conversation

@weidongxu-microsoft

Copy link
Copy Markdown
Contributor

Run Azure SDK Track 2 Checkstyle and SpotBugs on generated clients in the Azure Java Spector module. Checkstyle loads the SDK's Java-backed rules and retains the temporary InnerAssignment suppression for generated implementation/*ClientImpl.java files. ClientCore is unchanged.

Findings are report-only because existing fixtures do not all follow SDK conventions. CI attaches both XML reports to the test task.

Validated with the Azure Spector script and the emitter build, format, and lint commands.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: caff69e4-5771-496b-b598-b533a2a45f30
Copilot AI balanced review requested due to automatic review settings December 5, 2026 03:54
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/http-client-java
Show changes

@typespec/http-client-java - internal ✏️

Run Azure SDK Checkstyle and SpotBugs rules on generated Java test clients.

Copilot AI 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.

🟡 Changes recommended

The PowerShell changes break the build-test fixture by requiring reports its Maven stub never creates, while an empty Checkstyle regex alternative disables line-length enforcement.

2 open issues
What changed in this PR

Adds report-only Azure SDK lint checks to generated Java Spector clients. ClientCore remains unchanged.

Changes:

  • Runs Checkstyle and SpotBugs during Maven verify.
  • Uploads XML reports to CI and ensures Spector cleanup.
  • Adds SDK rules, suppressions, licensing, and an internal changelog entry.
File Description
packages/​http-client-java/​generator/​http-client-generator-test/​Spector-Tests.ps1 Runs analysis, uploads reports, and stops the server.
packages/​http-client-java/​generator/​http-client-generator-test/​pom.xml Configures report-only analyzers.
packages/​http-client-java/​generator/​http-client-generator-test/​linting/​spotbugs-include.xml Defines included bug patterns.
packages/​http-client-java/​generator/​http-client-generator-test/​linting/​spotbugs-exclude.xml Adds SDK bug exclusions.
packages/​http-client-java/​generator/​http-client-generator-test/​linting/​LICENSE.txt Includes the imported rules’ license.
packages/​http-client-java/​generator/​http-client-generator-test/​linting/​checkstyle.xml Adds SDK checks and temporary assignment suppression.
packages/​http-client-java/​generator/​http-client-generator-test/​linting/​checkstyle-suppressions.xml Adds SDK Checkstyle suppressions.
.chronus/​changes/​eng-java-azure-generated-code-lint.md Records the internal tooling change.

Review effort: Balanced

@azure-sdk-automation

azure-sdk-automation Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: caff69e4-5771-496b-b598-b533a2a45f30

Copilot AI 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.

🔵 Needs a closer look

An empty alternative in Checkstyle’s ignorePattern matches every line, disabling enforcement of the configured 120-character limit.

1 open issue
1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants