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

Issue #10745: Add inline config support for tests with multiple modules #10758

Merged
merged 2 commits into from Aug 30, 2021

Conversation

shashwatj07
Copy link
Contributor

Resolves #10745
Resolves #10171

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 if CI pass

@romani romani merged commit f4b0113 into checkstyle:master Aug 30, 2021
@@ -389,59 +378,27 @@ protected final void verifyWithLimitedResources(Configuration aConfig,
throws Exception {
// We return null here, which gives us a result to make an assertion about
final Void result = TestUtil.getResultWithLimitedResources(() -> {
verifyWithInlineConfigParser(aConfig, fileName, expected);
verifyWithInlineConfigParser(fileName, expected);
Copy link
Member

@rnveach rnveach Aug 31, 2021

Choose a reason for hiding this comment

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

@shashwatj07 @romani How are we verifying a configuration run without providing it said configuration?

When I remove the method parameter since aConfig is no longer used, I see ParenPad and SingleSpace tests creating a configuration for no reason. It doesn't make sense.

Edit: I think I get a sense now what this commit is doing. It's getting the configuration from the input file.

If this is not breaking tests, then we should remove the configuration from the method parameter as it no longer serves a purpose. We are expecting the configuration to be in the input file.

Copy link
Member

Choose a reason for hiding this comment

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

I feel more comfortable, for now, its not breaking tests by the new issue I created.

This can be a simple parameter removal in a new PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get your point. I wonder why CI didn't complain of unused parameter. I'll remove it.
I will send PR to throw proper exception.

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure about PMD or TeamCity, but Checkstyle itself has no check to catch something like this. I only found it because my Eclipse configuration is set to produce more errors on things like. We can't enable it in CI because it produces false exceptions that can't be suppressed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm suspecting PMD. Although, I get your point. Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@rnveach rnveach Aug 31, 2021

Choose a reason for hiding this comment

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

@pbludov You probably know PMD best. PMD has UnusedFormalParameter. Do we have it enabled and should it have caught this?
https://www.ing.iac.es//~docs/external/java/pmd/rules/unusedcode.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants