Skip to content
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

Merged
merged 3 commits into from
May 15, 2022
Merged

Some reworking for test structures #11603

merged 3 commits into from
May 15, 2022

Conversation

rnveach
Copy link
Member

@rnveach rnveach commented May 3, 2022

#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 and getModuleConfigs for IT.


if (moduleCreationOption == ModuleCreationOption.IN_TREEWALKER) {
protected void addConfigToChecker(Checker checker, Class<?> moduleClass,
Configuration moduleConfig) throws Exception {
Copy link
Member Author

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.

Copy link
Member

@nrmancuso nrmancuso left a 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:

@rnveach rnveach force-pushed the a_fixes branch 2 times, most recently from 88be7df to 31a41c0 Compare May 7, 2022 00:25
@nrmancuso nrmancuso assigned pbludov and unassigned nrmancuso May 7, 2022
@pbludov pbludov assigned romani and unassigned pbludov May 7, 2022
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item:

@romani romani assigned rnveach and unassigned romani May 7, 2022
@rnveach rnveach assigned romani and unassigned rnveach May 7, 2022
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge

@romani romani merged commit 3627e1f into checkstyle:master May 15, 2022
@rnveach rnveach deleted the a_fixes branch May 15, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants