Repository navigation
chore: allow test-library static imports in test sources - #1282
Merged
nkuprins merged 5 commits intoOct 30, 2026
Merged
Conversation
Contributor
|
Thanks for refactoring! IMO having two separate rules with regex filters is still a bit overkill here. Since Can we just keep it simple with a single |
nkuprins
reviewed
Oct 30, 2026
nkuprins
approved these changes
Oct 30, 2026
nkuprins
left a comment
Member
There was a problem hiding this comment.
LGTM. Thank you for your first contribution!
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose of the pull request
Fixes #1267.
The shared Checkstyle rules reject AssertJ's
assertThatstatic import although AssertJ is already a test dependency. Allow named imports from common test libraries using Checkstyle's native allowlist.What's changed?
AvoidStaticImportmodule withexcludesfor JUnitAssertions/Assumptions, MockitoMockito/ArgumentMatchers, and AssertJAssertions, as requested in review. No XPath, duplicate rules or directory regex filters remain.AvoidStarImportunchanged: both static and regular wildcard imports remain forbidden, including imports from the allowlisted libraries. Other static imports remain forbidden.testdependency scope to keep these libraries unavailable to production compilation. The allowlist itself is global; it does not enforce a test-source directory boundary.assertThat(...).containsExactly(...)inListUtilsTestalongside the existing JUnit assertions, preserving size, order and content coverage.AGENTS.mdand the configuration comment to describe the lint rule and Maven scope accurately.Validation
Latest review update: only replaces the introductory XML comment block with a scope warning beside
AvoidStaticImport. Parsed XML modules and property values are identical to2171455. Six-modulevalidate spotless:checkandgit diff --checkpassed for this update. The full test suite was not rerun for the comment-only change; the functional validation below was completed on2171455, whose nine GitHub checks also passed.fesod-common's actual compile/test classpaths with Maven and ran ten compiler checks: named imports from each of the five allowlisted owners fail on the production compile classpath and succeed on the test classpath../mvnw -B validate spotless:check: all six modules passed../mvnw -B clean package -pl fesod-common,fesod-shaded,fesod-sheet: 1,836 tests, 0 failures, 0 errors, 0 skips.git diff --checkpassed for the changed files.This revision was validated on Temurin JDK 25.0.5 using a workspace-local Maven cache and isolated temporary directories. No tests or assertions were modified or skipped for the review update. The multi-JDK matrix was not run locally; the new head must complete GitHub CI.
Checklist