Issue #14625: fix noinspectionreason for TestMethodWithoutAssertion#14812
Issue #14625: fix noinspectionreason for TestMethodWithoutAssertion#14812MANISH-K-07 wants to merge 1 commit into
Conversation
| * but not in this method | ||
| * @noinspectionreason TestMethodWithoutAssertion - until issue #14625 | ||
| * @noinspectionreason TestMethodWithoutAssertion - asserts in callstack, | ||
| * but not in this method |
There was a problem hiding this comment.
We already have similar rule in some other tools, can you recheck if we suppressed this already for other tools maybe pmd or ....
There was a problem hiding this comment.
@romani , pmd yes....
checkstyle/config/pmd-test.xml
Lines 107 to 110 in bb56e9d
There was a problem hiding this comment.
Can it help if we rename examineCheckSection to assertCheckSection ? May be we can extend config to register this method name as asset.
There was a problem hiding this comment.
Can it help if we rename
examineCheckSectiontoassertCheckSection? May be we can extend config to register this method name as asset.
theoretically, It should, but we would be extending config just for satisfying 2 methods
@romani , just pointing out, we have our methods named in chains.
examineCheckSection is followed by examineCheckSectionChildren and again examineCheckSubSection
Do we really want to extend our config to new method and hack all these just to workaround for one inspection that won't even impact users as much?
Please do correct me if I'm wrong, I don't mean to cross your suggestion 😃
There was a problem hiding this comment.
examineCheckSection is actually do assert by execution of
checker.process(files);
All Junit asserts are Custom Check that helps to parse java files.
We can add assert for checker to have no violations or errors after execution to testAllCheckSectionJavaDocs() as it is a field of class, so no suppression will be required.
| * but not in this method | ||
| * @noinspectionreason TestMethodWithoutAssertion - until issue #14625 | ||
| * @noinspectionreason TestMethodWithoutAssertion - asserts in callstack, | ||
| * but not in this method |
There was a problem hiding this comment.
Can it help if we rename examineCheckSection to assertCheckSection ? May be we can extend config to register this method name as asset.
|
@romani , please see post above at #14812 (comment) |
|
@romani , could you please assign this PR to yourself while we discuss how to proceed.. |
|
@MANISH-K-07, ping, please find time to finish this PR. |
|
@MANISH-K-07, ping, please find time to finish this PR. |
|
How to configure inspection: https://www.jetbrains.com.cn/en-us/help/inspectopedia/TestMethodWithoutAssertion.html We just need change name of method examineCheckSection only, suggestion assertCheckSection |
|
Everyone is welcome to continue this work. |
|
@MohanadKh03, while I am working on n your PR with write tag. |
|
Sure |
|
Yes |
|
Actually we do not need to rename do we ? I tried with and without renaming and since it was suppressed , both work since this is suppressed anyway so unless we are removing the suppression and extending it to config then we could also extend the old name right ? Also by extending the config does this mean adding it to the whitelist or what kind of extension exactly ? As it stands right now this can be merged if we are going to keep the suppression I dont really see any point of renaming |
|
we should remove suppression, this is whole reason of issue. |
|
Moved to #15884 |
Resolves #14625
TestMethodWithoutAssertioninspection is a permanent suppression forXdocsJavaDocsTest&XdocsPagesTest.Reason being same as for inspection
JUnitTestMethodWithNoAssertions.Ideally, in this case, both inspections function the same, I believe.