Repository navigation
Restore Track 2 Checkstyle line-length enforcement - #51520
Weidong Xu (weidongxu-microsoft) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: caff69e4-5771-496b-b598-b533a2a45f30
|
Azure Pipelines: Successfully started running 2 pipeline(s). 32 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Restoring global Checkstyle enforcement without resolving existing unsuppressed violations causes the default azure-core check to fail and exposes unrelated SDK builds to inherited failures.
1 open issue
What changed in this PR
Restores the shared Track 2 Checkstyle configuration’s 120-character line-length enforcement.
Changes:
- Removes the empty regex alternative that caused every line to be ignored.
- Preserves exceptions for code snippets, links, URLs, and single-word comments.
| File | Description |
|---|---|
| eng/lintingconfigs/checkstyle/track2/checkstyle.xml | Corrects and simplifies the LineLength ignore pattern. |
Review effort: Balanced
| <!-- Allow codeSnippet to override max line length --> | ||
| <!-- Allow comment with single word to override max line length --> | ||
| <property name="ignorePattern" value=".*(\{@codesnippet.*\}|<a href)|^ *\* *[^ ]+$||http://|https://|^ *\* *[^ ]+$"/> | ||
| <property name="ignorePattern" value="\{@codesnippet.*\}|<a href|^ *\* *[^ ]+$|https?://"/> |
|
Closing without changing the rule. Removing the empty alternative from The extra |

Fix the Track 2 Checkstyle
LineLengthignore pattern. Its empty regex alternative matches every line, so the 120-character limit never runs. The corrected pattern preserves the code snippet, link, URL, and single-word comment exceptions.Found while syncing the SDK rules in microsoft/typespec#12756. Verified with Java regex matching that overlong code is no longer ignored and the intended exceptions still match.
Rollout: Restoring enforcement may expose existing violations. A scan of
azure-corealone found 292 candidate lines across 77 files before applying SDK suppressions. Assess the baseline before merging.