Skip to content

Issue #6971: Added implementation for NoArrayTrailingCommaCheck#7228

Merged
romani merged 1 commit into
checkstyle:masterfrom
shashvat-kedia:Fix-6971
Dec 28, 2019
Merged

Issue #6971: Added implementation for NoArrayTrailingCommaCheck#7228
romani merged 1 commit into
checkstyle:masterfrom
shashvat-kedia:Fix-6971

Conversation

@shashvat-kedia

@shashvat-kedia shashvat-kedia commented Oct 27, 2019

Copy link
Copy Markdown
Contributor

@shashvat-kedia

shashvat-kedia commented Oct 27, 2019

Copy link
Copy Markdown
Contributor Author

@romani I have added an implementation of NoArrayTrailingCommaCheck.

@rnveach

rnveach commented Oct 27, 2019

Copy link
Copy Markdown
Contributor

@SD1998 Thanks. It is best we try to finish the already opened PRs. One is waiting on CI to pass.

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please review failures in Teamcity CI (you can login as guest)
Please review Travis CI for failures, please address them.
In Travis there should be only one failure - at ensure that all modules are used in no exception configs
but please send PR to contribution repo also, we will merge this PR and contribution PR together. Please share link to PR in this PR description.

items to improve:

Comment thread pom.xml Outdated
Comment thread src/xdocs/config_coding.xml Outdated
@romani

romani commented Nov 18, 2019

Copy link
Copy Markdown
Member

@SD1998 , CI need to be green to let me merge,
https://travis-ci.org/checkstyle/checkstyle/jobs/611305595#L1205 do you have problems to resolve this ?
All Checks need to be active in our config, this Check with ignore severity, as it confly with another Check.

Only one CI failure is expected - about new Check presence in contribution config, you did checkstyle/contribution#417

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See comment above

In addition .... New Checks need to make sure they are compliant with xpath suppression, please add test to https://github.com/checkstyle/checkstyle/tree/master/src/it/java/org/checkstyle/suppressionxpathfilter

@romani

romani commented Dec 2, 2019

Copy link
Copy Markdown
Member

@SD1998 , please rebase and resolve conflict.

please add xpath tests.

@romani

romani commented Dec 12, 2019

Copy link
Copy Markdown
Member

@SD1998 , ping.

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@romani runVerifications method in AbstractXpathTestSupport.java tries to extract the row number as well as the column number but in NoArrayTrailingCommaCheck.java the error message only comprises of the row no. (so that it is consistent with what is done in ArrayTrailingCommaCheck.java) should I modify the method to extract only the row numbers incase the error message does not contain column numbers?

@romani

romani commented Dec 19, 2019

Copy link
Copy Markdown
Member

yes, looks like we have NO support in Xpath https://github.com/checkstyle/checkstyle/blob/master/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java#L55 for Checks that report only line number.

It is kind of reasonable as xpath imply detection of exact AST where violation is happening.
Lets report violation on certain line and column.
Extra comma is definitely has line and column so you will place violation on exact symbol that Check do not like - that is good.

[ERROR] AllChecksTest.testAllCheckstyleModulesInCheckstyleConfig:463 checkstyle_checks.xml is missing module: NoArrayTrailingComma ==> expected: but was:

please add Check to checkstyle_checks.xml but with "ignore" severity, in comment above explain that is conflicts with another Check.

[checkstyle] [ERROR] /home/travis/build/checkstyle/checkstyle/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckTest.java:6:1: Disallowed import - org.junit.Test. [ImportControlTest]

we migrated to Junit5 recently, please use junit 5 types, look at other Tests for examples.

@romani romani self-assigned this Dec 19, 2019
@rnveach

rnveach commented Dec 20, 2019

Copy link
Copy Markdown
Contributor

yes, looks like we have NO support in Xpath AbstractXpathTestSupport for Checks that report only line number.

See #5777

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@romani I have made all the changes.

@romani

romani commented Dec 24, 2019

Copy link
Copy Markdown
Member

upps .... I did not notice your comment and pushed all changes myself to your remote branch with force.

Please push one more time from your local. Looks like I did the same code changes as you..... I thought that you abandoned your PR.

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@romani Done.

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

items to improve:

Comment thread config/checkstyle_checks.xml
Comment thread src/xdocs/config_coding.xml Outdated
@romani

romani commented Dec 24, 2019

Copy link
Copy Markdown
Member

Please satisfy spell checker by whitelisting of word https://travis-ci.org/checkstyle/checkstyle/jobs/629058068#L281

Regression report:

I see no violations from your Check.
Please remove from config all Checks that are not your new Check. Please generate report on all projects in property file, we shy have some violations in report.

Comment thread src/xdocs/config_coding.xml
@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@romani I have updated the regression report.

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code is good.
report is good.

@rnveach , please do final review.

@romani romani assigned rnveach and unassigned romani Dec 26, 2019
@rnveach

rnveach commented Dec 28, 2019

Copy link
Copy Markdown
Contributor

Contribution PR: checkstyle/contribution#417

CI failed to notice that PR is not for checks-nonjavadoc-error.xml .

@romani

romani commented Dec 28, 2019

Copy link
Copy Markdown
Member

validation is not ideal ....
message is pointing to correct files - https://github.com/checkstyle/checkstyle/blob/master/.ci/travis/travis.sh#L509
so it is just human mistake, confusion file will be removed at checkstyle/contribution#435

@romani romani merged commit f0af108 into checkstyle:master Dec 28, 2019
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.

5 participants