Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.
pbludov on issue-4219-shadowed-imports
pbludov on issue-9149-stack-overflow2
Issue #9149: removed input caus… (compare)
pbludov on issue-9149-stack-overflow2
minor: fix sonar violation 'Ref… doc: releasenotes 8.39 [maven-release-plugin] prepare … and 4 more (compare)
pbludov on issue-9149-stack-overflow2
pbludov on issue-9149-stack-overflow2
Issue #9149: workaround for sta… (compare)
pbludov on issue-9149-stack-overflow2
Issue #9149: workaround for sta… (compare)
pbludov on issue-9149-stack-overflow2
minor: fix sonar violation 'Ref… doc: releasenotes 8.39 [maven-release-plugin] prepare … and 4 more (compare)
pbludov on master
Issue #5951: Incorrect warning … minor: update wercker.sh to use… dependency: bump org.eclipse.jg… and 18 more (compare)
pbludov on issue-8864-cmd-set
pbludov on issue-9021-fix-josm
pbludov on issue-9021-fix-josm
Issue #9021: fix josm validation (compare)
pbludov on issue-9021-fix-josm
pbludov on issue-8951-remove-buddy
pbludov on issue-6722-missing-asterisk
pbludov on issue-9124-stack-overflow-parenpad
pbludov on issue-8018-operator-wrap
pbludov on issue-9101-fix-stack-overflow
pbludov on issue-4219-shadowed-imports
Issue #4219: UnusedImports does… (compare)
github-actions[bot] on issue-4219-shadowed-imports
Issue #8651: Checkstyle fails o… Issue #4219: UnusedImports does… (compare)
pbludov on issue-8018-operator-wrap
Issue #8018: AST based operator… (compare)
@rnveach @romani What kind of example can be provided for this
<module name="LeftCurly">
<property name="ignoreEnums" value="false"/>
</module>
Issue: checkstyle/checkstyle#7582
Link to documentation: https://checkstyle.org/config_blocks.html#LeftCurly
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.junit.platform:junit-platform-commons:jar:1.6.2 from/to central (https://repo.maven.apache.org/maven2): Authorization failed for https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.6.2/junit-platform-commons-1.6.2.jar 403 Forbidden
Is there any issue with the VisibilityModifer? I tried running it with allowPublicImmutableFields
as true
on the given example in the doc
public class ImmutableClass
{
public final ImmutableSet<String> includes; // No warning
public final ImmutableSet<String> excludes; // No warning
public final java.lang.String notes; // No warning
public final BigDecimal value; // No warning
public ImmutableClass(Collection<String> includes, Collection<String> excludes,
BigDecimal value, String notes)
{
this.includes = ImmutableSet.copyOf(includes);
this.excludes = ImmutableSet.copyOf(excludes);
this.value = value;
this.notes = notes;
}
}
and according to the doc it should throw no warning but it does...
$ java -jar ../checkstyle-8.30-all.jar -c config1.xml Test1.java
Starting audit...
[ERROR] C:\Users\Shrey\Desktop\Checkstyle jar\visibilityModifier\Test1.java:3:37: Variable 'includes' must be private and have accessor methods. [VisibilityModifier]
[ERROR] C:\Users\Shrey\Desktop\Checkstyle jar\visibilityModifier\Test1.java:4:37: Variable 'excludes' must be private and have accessor methods. [VisibilityModifier]
[ERROR] C:\Users\Shrey\Desktop\Checkstyle jar\visibilityModifier\Test1.java:5:33: Variable 'notes' must be private and have accessor methods. [VisibilityModifier]
[ERROR] C:\Users\Shrey\Desktop\Checkstyle jar\visibilityModifier\Test1.java:7:20: Variable 'someValue' must be private and have accessor methods. [VisibilityModifier]
Audit done.
Checkstyle ends with 4 errors.
@sulkykookie I am not sure, what is wrong here but you can check in VisibilityModifierCheckTest.java
where you can find this test:
public void testAllowPublicFinalFieldsInImmutableClass() throws Exception {
final DefaultConfiguration checkConfig =
createModuleConfig(VisibilityModifierCheck.class);
checkConfig.addAttribute("allowPublicImmutableFields", "true");
final String[] expected = {
"12:39: " + getCheckMessage(MSG_KEY, "includes"),
"13:39: " + getCheckMessage(MSG_KEY, "excludes"),
"16:23: " + getCheckMessage(MSG_KEY, "list"),
"34:20: " + getCheckMessage(MSG_KEY, "value"),
"36:24: " + getCheckMessage(MSG_KEY, "bValue"),
"37:31: " + getCheckMessage(MSG_KEY, "longValue"),
"41:19: " + getCheckMessage(MSG_KEY, "C_D_E"),
};
verify(checkConfig, getPath("InputVisibilityModifierImmutable.java"), expected);
}
I think running test case will help you to understand why your example doesn't work. InputVisibilityModifierImmutable.java
is a file with examples for this Check.
@romani @rnveach I am generating diff report.
I am running following commandgroovy diff.groovy --localGitRepo ../../checkstyle --baseBranch master --patchBranch 7728-updateabtractchecks-customimportorder --config my_check.xml --listOfProjects projects-to-test-on.properties
I am getting following error.
Caught: java.io.IOException: Cannot run program cmd in directory (directory of checkstyle-tester): Create Process error=5, Access is denied
Please help.
Access is denied
println
to get to know what command isfailing
MainTest.java
which is extremely large, so I am getting methodLength and FileLength issues. I had wrote suppressions in suppressions.xml
file du to which antrun-phase-verify
is passing but online checkstyle tests are failed, Let me know the possible approach to solve this problem. All the other PRs of Indentation is dependent on this PR for their regression tests.