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 #15026: Added support to check input file against whole google configuration for google IT tests #15028

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

Zopsss
Copy link
Contributor

@Zopsss Zopsss commented Jun 18, 2024

issue #15026

created a new method: verifyWithWholeGoogleConfig() which helps us to check the input file against whole google configuration. We just require to pass the file path to the method and everything else will work like a magic 🔮🪄

Comment on lines 33 to 37
@Test
public void testAnnotation() throws Exception {
final String[] listOfModules = {
"AnnotationLocationMostCases",
"InvalidJavadocPosition",
};

final String filePath = getPath("InputClassAnnotations.java");

verifyWithGoogleConfigParser(listOfModules, filePath);
verifyWithWholeGoogleConfig(filePath);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example of using the new method 🐪🐫

@rnveach rnveach self-assigned this Jun 18, 2024
@Zopsss Zopsss force-pushed the new-verify-method branch 3 times, most recently from 332df57 to c3f84d0 Compare June 19, 2024 10:59
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.

last minors:

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.

@rnveach , please share your concerns and think if we can improve in separate PR on them.
This PR is "blocking" migration to whole configs, that will be significant effort, but it will NOT touch Abstract classes, so we can do fixes in parallel.

@romani romani requested a review from rdiachenko June 19, 2024 14:10
googleConfig.addChild(treeWalkerConfig);
}

verifyWithItConfig(googleConfig, filePath);
Copy link
Member

Choose a reason for hiding this comment

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

Same as other verifyWithItConfig comment.

Copy link
Member

Choose a reason for hiding this comment

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

This is also dropped for the same reason, but also this whole method should be removed eventually when we switch everything to the whole config.

Copy link
Member

Choose a reason for hiding this comment

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

@Zopsss Where is issue to eventually go back to convert other tests? This should be added to the end there and a comment until http://.... should be added to this method.

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
Contributor Author

@Zopsss Zopsss Jun 20, 2024

Choose a reason for hiding this comment

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

added until message

// until https://github.com/checkstyle/checkstyle/issues/14937
/**
* Performs the verification of the file with the given file path and config.
*
* @param config config to check against.
* @param filePath input file path.
* @throws Exception if exception occurs during verification process.
*/
protected void verifyWithItConfig(Configuration config, String filePath) throws Exception {

Copy link
Member

Choose a reason for hiding this comment

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

@Zopsss until was placed in wrong location. until is basically reminding us the mentioned method is to be removed. verifyWithItConfig is the way we will be proceeding now (unless something comes up), so this method should stay.

The note should be on verifyWithConfigParser in AbstractGoogle. We are only keeping it until all tests move over to full config testing. Once we do, it can be removed completely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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.

items:

src/main/resources/google_checks.xml Outdated Show resolved Hide resolved
@rnveach
Copy link
Member

rnveach commented Jun 20, 2024

Blocked from merging by #15072 , but code updates and reviews can still be done.

@romani
Copy link
Member

romani commented Jun 22, 2024

@rnveach , please review this PR as if it does not have update in google_config.xml (moved to separate PR).
if no other comments, please approve PR and I will make sure that #15072 is merged first and this PR is rebased.

Copy link
Contributor

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

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

lgtm

@rnveach
Copy link
Member

rnveach commented Jun 23, 2024

@Zopsss Please rebase.

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.

rebased in github
ok to merge

@rnveach rnveach removed the blocked label Jun 23, 2024
@rnveach rnveach merged commit cf267f3 into checkstyle:master Jun 23, 2024
111 checks passed
@Zopsss Zopsss deleted the new-verify-method branch June 23, 2024 14:38
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