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-9146-java11
Issue #9146: specify java versi… (compare)
pbludov on maven
pbludov on issue-9146-java11
minor: cleanup whitelist words Issue #7877: Removed redundant … Issue #5711: JavadocTagContinua… and 9 more (compare)
pbludov on issue-9310-java11-inputs
pbludov on issue-9310-java11-inputs
Issue #9310: test inputs should… (compare)
pbludov on issue-9310-java11-inputs
Issue #9310: test inputs should… (compare)
pbludov on issue-9310-java11-inputs
Issue #9152: Record implementin… infra: add checkout_from suppor… dependency: bump archunit-junit… and 3 more (compare)
pbludov on issue-9310-java11-inputs
minor: cleanup whitelist words Issue #7877: Removed redundant … Issue #5711: JavadocTagContinua… and 1 more (compare)
pbludov on issue-9310-java11-inputs
Issue #9310: test inputs should… (compare)
pbludov on issue-9310-java11-inputs
Issue #9310: test inputs should… (compare)
pbludov on issue-9310-java11-inputs
Issue #9310: test inputs should… (compare)
pbludov on issue-9310-java11-inputs
#Issue #9310: test inputs shoul… (compare)
pbludov on master
doc: fix checkstyle jar version… Issue #9297: solve spotbugs vio… (compare)
pbludov on issue-9297-spotbugs-11
pbludov on issue-9146-java11
Issue #9146: update javassist t… Issue #9297: solve spotbugs vio… Issue #9146: switch to jdk 11 i… and 1 more (compare)
pbludov on issue-9146-java11
Issue #9146: switch to jdk 11 i… Issue #9146: update javassist t… Issue #9297: solve spotbugs vio… (compare)
pbludov on issue-9146-java11
Issue #9146: switch to jdk 11 i… (compare)
pbludov on issue-9146-java11
Issue #9146: upgrade minimal re… Issue #9146: switch to jdk 11 i… (compare)
pbludov on issue-9297-spotbugs-11
Pull #9298: change job to check… Issue #9297: solve spotbugs vio… (compare)
pbludov on issue-9297-spotbugs-11
minor: remove pitest suppressio… Issue #9292: disable markdownli… minor: Fix github issue templat… and 1 more (compare)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceDirectories>
<sourceDirectory>activiti-api-impl</sourceDirectory>
</sourceDirectories>
<configLocation>./checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<configLocation>./checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
Hi everyone, I would like to know if there is a check in Checkstyle which verifies the correctness of placeholders in String.format
or any similar formatting method?
Here are 3 examples:
jshell> String.format("Hello, %s", "Checkstyle");
$1 ==> "Hello, Checkstyle"
jshell> String.format("Hello, %s", "check", "style");
$1 ==> "Hello, check"
jshell> String.format("Hello, %s");
| Exception java.util.MissingFormatArgumentException: Format specifier 'Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '%s'
at java.base/java.util.Formatter.format(Formatter.java:2672)
at java.base/java.io.PrintStream.format(PrintStream.java:1053)
at java.base/java.io.PrintStream.printf(PrintStream.java:949)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.error(JShellTool.java:728)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.errormsg(JShellTool.java:867)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.displayEvalException(JShellTool.java:3451)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.displayException(JShellTool.java:3425)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.displayException(JShellTool.java:3418)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.handleEvent(JShellTool.java:3582)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSource(JShellTool.java:3550)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSourceCatchingReset(JShellTool.java:1301)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processInput(JShellTool.java:1203)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1176)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:975)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:254)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)