-
-
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
Issue #11214: specified violation message in EmptyLineSeparatorCheck #11408
Conversation
Tests are failing |
@romani Is it important to remove the "com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck" This file from Inline config Parser [src/test/java/com/puppycrawl/tools/checkstyle/bdd/InlineConfigParser.java] because if i remove it it is not excepting violation above and below message and in some file there is no other option rather than write violation above/below |
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.
From CI:
Violation message should be specified on line 38 in /home/vsts/work/1/s/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/emptylineseparator/InputEmptyLineSeparatorNewMethodDef.java
https://dev.azure.com/romanivanovjr/romanivanovjr/_build/results?buildId=8087&view=logs&j=c902ebb4-c9f8-5f09-4e17-ff78fbbc842e&t=9ca98c81-ff64-58f0-9d03-a23ac1c4a111&l=572
Please follow what is requested
Items
...uppycrawl/tools/checkstyle/checks/whitespace/emptylineseparator/InputEmptyLineSeparator.java
Outdated
Show resolved
Hide resolved
...tyle/checks/whitespace/emptylineseparator/InputEmptyLineSeparatorRecordsAndCompactCtors.java
Show resolved
Hide resolved
@romani should i shorten the name of class ? |
I am not sure in context of what class you talking about. |
line no 14 is going to long I am thinking to create a new class or rename the class |
@Kevin222004 can you just wrap the line? |
I have tried it before but it is giving the error some thing like this for this I think i have to use violation above but in violation above it is giving error |
@Kevin222004 try to wrap line after |
@nick-mancuso Thank you for the help it is ok now |
@romani I am getting this error I have run the coverage test in EmptylineseparaterCheck Test file it is successfully passed |
Please learn about code coverage. |
@romani can you please give a little more hint to solve coverage issue I have learnt about it But i Don't understand how to solve it |
@Kevin222004 for future reference: it is more helpful to share CLI output than screenshots. In regards to code coverage, have you generated a Jacoco report as mentioned in #11408 (comment)? |
yes I have Generated the jacoco report but it is very big how i can share here |
No need to share; take time to read and understand report, and try to figure out how we lost coverage as a result of your changes here. |
@nick-mancuso according to error Coverage is failing over here Line 556 in c20fc81
I have write message where violation above/below is mentioned this time in my previous pr I have not make any changes in violation above/below pattern. In this EmptyLineSeparator check it is given error where violation above/below is mentioned if I cant write a proper message |
Coverage was 100%, before your change, so it means you modified Input in such a way to cause it, please revert changes one by one to catch undesirable modification |
Please fix drone CI failure |
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.
...test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java
Outdated
Show resolved
Hide resolved
@romani please review |
@romani I forget to fix drone ci, also fixed up pi testing |
Please fix drone violationns
|
@romani can you please give any hint to solve this pi test whitespace error Actual: if (ast.getLineNo() > 1 && !hasEmptyLineBefore(ast)) { EmptyLineSeparatorCheck.java.html: if (lineNo >= number) { Ignore: Diff: if (ast.getLineNo() > 1 && !hasEmptyLineBefore(ast)) { +EmptyLineSeparatorCheck.java.html: if (lineNo >= number) { Difference between 'Actual' and 'Ignore' lists is detected, lists should be equal. build will be failed. |
You placed comment somewhere in input and it resulted in this. You can revert comments one by one and run pitest to see which caused a problem. |
@Kevin222004 please see remaining failure in |
@nick-mancuso can you please give look to this drone ci error I have cleared it in my before commit But i feel that it might not be good src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/whitespace/emptylineseparator/InputEmptyLineSeparatorRecordsAndCompactCtors.java:21: error: invalid method declaration; return type required I have change all the violation of 'COMPACT_CTOR_DEF' in 'METHOD_DEF' Diff: if (field.findFirstToken(TokenTypes.IDENT) != null) { FinalLocalVariableCheck.java.html: && isSameVariables(storedVariable, variable) FinalLocalVariableCheck.java.html: == ast.getParent()) { FinalLocalVariableCheck.java.html: if (ast.getParent().getType() == TokenTypes.SWITCH_RULE Difference between 'Actual' and 'Ignore' lists is detected, lists should be equal. build will be failed. can you give some more hint on it |
@Kevin222004, if this issue is hard for you please choose different Check and try to fix same problem in it. And come back to this pR later on. |
Issue #11214: specified violation message in EmptyLineSeparatorCheck