-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Some reworking for test structures #11603
Conversation
|
||
if (moduleCreationOption == ModuleCreationOption.IN_TREEWALKER) { | ||
protected void addConfigToChecker(Checker checker, Class<?> moduleClass, | ||
Configuration moduleConfig) throws Exception { |
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.
This is the method that can be overridden to allow new walkers and why the old enum way had to be removed.
src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java
Outdated
Show resolved
Hide resolved
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.
Couple questions, only one minor item:
src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java
Outdated
Show resolved
Hide resolved
src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java
Show resolved
Hide resolved
88be7df
to
31a41c0
Compare
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.
item:
src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java
Outdated
Show resolved
Hide resolved
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.
Ok to merge
#11604
First commit is a simple synchronize between Test and IT where similar code is.
Second commit is the bigger change. I reworked how we build the Checker tree so it is more streamlined and not passing around the enumeration.
createChecker
will now handle the current given module and identify if it needs a TreeWalker or other similar intermediary between it and the module. It also removed random config names and more closely used the ones they represent.I could not make similar changes to the IT side as the IT side has some weird complexities that need to be dealt with. We pass the name of the check and not the full class. We have to pull things from an existing config, and we only do partial pulls, still rebuild the missing pieces. There are also some tests that pull in more information from the config to not duplicate it making it all very complicated and needing its own rewrite.
I at least removed and centralized the code for
getModuleConfig
andgetModuleConfigs
for IT.