-
Notifications
You must be signed in to change notification settings - Fork 747
Adds ArchUnit tests for naming conventions #2077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds ArchUnit tests for naming conventions #2077
Conversation
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
the tests are currently failing, but this is only because I originally wrote the code against my other PR, which changed the signature of one of the methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Comments are observations that you can change or not, up to you. I'm fine taking this PR and then tuning later.
Please add the exception for methods you changed in the other PR. Then we can merge this immediately. The. The other PR can modify the tests as needed.
|
||
@SuppressWarnings("AccessStaticViaInstance") | ||
final ArchRule methodsNotFollowingConvention = noMethods().that() | ||
.arePublic() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All methods should follow the convention regardless of visibility.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2077 +/- ##
=========================================
Coverage 83.84% 83.84%
Complexity 2414 2414
=========================================
Files 236 236
Lines 7330 7330
Branches 389 389
=========================================
Hits 6146 6146
Misses 952 952
Partials 232 232 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Adds ArchUnit tests to validate naming conventions.
kind of jank, and could probably be improved, as I don't have experience with ArchUnit.
Based on the discussion in #2074
There are several different places where the test fails, so those places are special-cased to be ignored (per the discussion). Many of those places, however, could (and should) be package-private. (specifically, the instances where a method either starts with or ends with an underscore)
Before submitting a PR:
@link
JavaDoc entries to the relevant documentation on https://docs.github.com/en/rest .mvn -D enable-ci clean install site "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
locally. If this command doesn't succeed, your change will not pass CI.main
. You will create your PR from that branch.When creating a PR: