Issue #18064: added ArrayBracketNoWhitespace check#18240
Conversation
|
Please read and watch videos at Starting_Development. |
|
Hi @romani , |
|
Just debug test and trace all lines to understand why there is no violation. All is debug-able. |
|
@saad please make sure commit should be only one so, please squash all commits into single one. |
|
@M-SaaD-H please push the changes so we can see what's wrong with XpathRegression tests. It's little hard to understand from images. |
|
@mohitsatr I have pushed the code. |
|
Hi @mohitsatr can you please look into the CIs, I can't really get why they are failing. |
|
Hello Saad my advice is that you have to be run the command mvn clean verify again and run this command again and again until BUILD SUCCESS will not encountered because same error also came in my checks so I simply did to ran command mvn clean verify and when BUILD SUCCESS showing then I push my code and all checks passed. |
|
Hi @SURYANSHUAGRAWAL2006 , |
|
For the run-inspections failure open the ci failes they have given this link you will se the inspections result open those links and fix those issues Similarly for other CI failures check the logs |
|
Hello Saad I saw your build failure this is occurring not because of your code or check style it is because of maven problem so, Kindly rerun all CI best way close the pr then reopen the pr then all CI will run again and then you check all CI is passing or not but I am sure this is not your code problem rather than it is problem of maven internal. |
|
Hi @romani |
ce465be to
b2c32cd
Compare
bf67dc9 to
8bb25c4
Compare
|
@M-SaaD-H Green CI is a good sign. Take to run regression. Please go through the section Executing generation using github action and try to generate the report. Example PR: #17329 |
47b8d0f to
4d1133d
Compare
|
GitHub, generate report |
|
Report generation failed on phase "make_report", |
|
Report generation failed on phase "make_report", |
|
@M-SaaD-H Config in the Pr's description is not valid. It has to be like: https://gist.githubusercontent.com/mohitsatr/0e04070f847926ea44bf7eda88706807/raw/f9470db307d730a651e9c93cad776d6b592839e8/textblockgooglestyleformatting.xml. Replace Textb...Check with your check |
b3e5050 to
c05d721
Compare
| </details> | ||
| </checkerFrameworkError> | ||
|
|
||
|
|
|
GitHub, generate website |
|
ping @romani |
|
ping @mohitsatr |
|
|
||
| public class InputArrayBracketNoWhitespaceBranchCoverage { | ||
|
|
||
| // Edge cases to cover missing branches in findClosestTokenAfter |
There was a problem hiding this comment.
what is findClosestTokenAfter ? and please remove this line.
There was a problem hiding this comment.
also rename the file name, no need to mention BranchCoverage
|
|
||
| // Nested array access with complex expressions | ||
| int[][] matrix = new int[5][5]; | ||
| int result1 = matrix[arr[0]][arr[1]]; |
There was a problem hiding this comment.
int result2 = matrix[ arr[0]][arr[1 ]];add this case
| int[] arr2 = new int [10]; // violation ''\[' is preceded with whitespace.' | ||
| int[] arr3 = new int[ 10]; // violation ''\[' is followed by whitespace.' | ||
| int[] arr4 = new int[10 ]; // violation ''\]' is preceded with whitespace.' | ||
| int[] arr5 = new int[ 10 ]; |
There was a problem hiding this comment.
add one more case here:
int []arr5 = new int[10];There was a problem hiding this comment.
add 2 examples, one should contain correct code only and other should contain violations.
|
GitHub, generate report |
|
GitHub, generate report |
|
Hey @Zopsss , |
|
False-positive: The Similar other case: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/6963b5f_2026150836/reports/diff/apache-ant/index.html#A8 |
|
@M-SaaD-H fyi, do not wait for maintainers to review the report. You should do it yourself and report any false-positive/negative you find and fix them. It accelerates the review process |
|
I initially assumed these were valid violations since formatter output often uses spaces in cases like |
|
GitHub, generate report |
|
Hey @Zopsss , |
fixes #18064
New module config: https://gist.githubusercontent.com/M-SaaD-H/4550b2874ee138f74ef18ca95b45c596/raw/7091fa5650a9bb166694a74a36ce601e7beeef7e/arraybracketnowhitespace.xml
Contribution repo: checkstyle/contribution#1007