checkstyle

JavadocPackage usage in checkstyle

Hi all, I am in the process of converting my checkstyle version 4.0 configurations to version 5.0. Hence, I have added the following to replace older "PackageHtml", <module name="JavadocPackage"> <metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="info"/> <property name="allowLegacy" value="true"/...

Checkstyle source control intergration

I've been looking into checkstyle recently as part of some research into standard coding conventions. Though it seems like it is perfectly suitable for brand new projects, it seems to have a huge barrier to adoption for already existing projects as it doesn't seem to supply a method of only checking new or edited code. Maybe I'm wrong?...

How do you translate from checkstyle.xml to eclipse code style format/profile and back again?

I have eclipse code formatter and profile xml docs and I'd like to build a checkstyle.xml which I can use in my maven builds to run reports and generate the eclipse files. maven-eclipse-plugin appears to be able to generate the eclipse files from the checkstyle.xml (I think), but I'm not sure how to go the other way and I'm not looking...

Can I disable CheckStyle complaints for deprecated methods and classes?

I'm maintaining an API that has deprecated some public static fields. CheckStyle complains loudly about these but I'd rather have it ignore them completely since I've dealt with the problem by marking the fields as deprecated. Specifically, the library has constants for enumeration (public static final) but the they are not marked as ...

Cleaning up code breaks binary compatibility

I'm working on a project which is being used by a number of people I don't know. We've done a fairly good job of bringing down the CheckStyle warnings and the thing is about a low as its going to get without breaking binary compatibility. The majority of the remaining warnings are caused by constants (public static final) missing the fi...

problem installing Checkstyle on Eclipse 3.5

I'm having trouble installing the Checkstyle plugin on Eclipse platform 3.5, Java EE IDE 1.2. I've pasted the error message below when I try to install Checkstyle. Thanks in advance for your help. ERROR MESSAGE Cannot complete the install because one or more required items could not be found. Software currently installed: m2eclipse ...

Should the RequireThis check in Checkstyle be enabled?

One of the built-in Checkstyle checks is RequireThis, which will go off whenever you don't prepend this. to local field or method invocations. For example, public final class ExampleClass { public String getMeSomething() { return "Something"; } public String getMeSomethingElse() { //will violate Checkstyl...

Is there a way to force Checkstyle to ignore particular warning in the source code?

PMD has a way to ignore particular warning with //NOPMDcomment inside Java source file. Does Checkstyle have similar option? ...

StackOverflowError with Checkstyle 4.4 RegExp check

Hello, Background: I'm using Checkstyle 4.4.2 with a RegExp checker module to detect when the file name in out java source headers do not match the file name of the class or interface in which they reside. This can happen when a developer copies a header from one class to another and does not modify the "File:" tag. The regular expres...

How do I ensure that copyright notices accompany all of my source files for a java-maven build?

Is there a standard way people enforce the inclusion of copyright notices in their java/maven builds? I realize that it shouldn't be necessary since the product itself is copy-written and if someone has my source I have much bigger problems, but I'm being asked to check and was wondering if checkstyle, PMD or something else handled this...

JavaScript code checking beyond JSLint

Hello Everyone, I'm looking for something that works like Checkstyle for JavaScript. I know about JSLint and I'm already using Google's Closure compiler, but these mostly check for syntactic issues. Checkstyle can check for braces on the wrong line, but it also makes it possible to write custom checks like don't use HashMap. I'm lo...

Eclipse Checkstyle with configuration and SuppressionFilter on server

I have configured my Eclipse to use a remote checkstyle configuration that is located on a server, which I reach via HTTP. This works fine, but the configuration contains: <module name="SuppressionFilter"> <property name="file" value="${basedir}/checkstyle-filter.xml"/> </module> So I try to set an additional property "basedir" which...

Why does Checkstyle tries to create a Check for my Listener

I have implemented a Checkstyle Listener. It worked before, (I think with a 5.0 beta release), but now (with 5.0), checkstyle fails with the following CallStack Unable to create Checker: cannot initialize module de.xyz.toxicity.TeamcityListener - Unable to instantiate de.xyz.toxicity.TeamcityListener com.puppycrawl.tools.checkstyle....

What is the difference between the various xsl files included with CheckStyle?

The CheckStyle distribution contains several example XSL files for formatting reports. With CheckStyle 5.0, they are: checkstyle-author.xsl checkstyle-csv.xsl checkstyle-frames-errors.xsl checkstyle-frames.xsl checkstyle-noframes-sorted.xsl checkstyle-noframes.xsl checkstyle-simple.xsl checkstyle-text.xsl Some of the names are more ...

Checkstyle warning when an incorrect class name is specified

Hello, I have a "checkstyle" ant task. Is there a way to flag a warning, when an incorrect class name is mentioned in "include" files. Thanks, Sandhya ...

Including additional source locations for chekstyle in ant task

I am running checkstyle checks from an ant task. I have configured both properly and can run the task without any problems. But I have another project/folder with additional source files (lets call them third party sources) which are referenced from within my source files (primary source). I want checkstyle to only check the primary sou...

Checkstyle: cannot summarise issues per author ?

Hi all, I'm trying to use checkstyle for a java project but I can't seem to get it working properly: While it apparently runs smoothly, the html report doesn't give any info per authors as it should, i.e. the authors table is empty. The thing is I don't know how checkstyle identify an author. Does it look at the java doc tag @author ?...

Maven 2 checkstyle plugin version 2.5 - Problem with configLocation

Hi there, I am using checkstyle plugin in maven 2. I now want to switch my config file, from the default one to a) an online file, or b) a local file. I tried the following two things, which both didnt work. Any suggestions? A) Local file, which is directly in my project folder next to the pom.xml <plugin> <groupId>org.apache.mav...

Eclipse checkstyle checks log4j, and I can't make it stop

I can't find any configuration for the recent tendency of the Eclipse checkstyle plugin (I'm running 5.1.0) to complain about style issues in log4j.property files. It's not in my checkstyle.xml, it doesn't happen when I run checkstyle outside of eclipse, and I don't see an eclipse preference. Is this controllable? ...

Excluding classes in maven 2 checkstyle plugin reports

Hi, I have a maven 2 project and I want to configure my Checkstyle report plugin so that only some of my classes are analysed. I have found the maven.checkstyle.excludes property, but despite passing this as a command line parameter (using "-D=maven.checkstyle.excludes=...") I can't get it to work. I can't find anything on the Plugin ...