Description

Main idea of Checkstyle project is to automate and to ease code-review process; to assist developers in complying with the company's Code-standard, and allow them to fix and eliminate any minor problem upon just saving the file.
We are strongly convinced that it is much more easier and convenient to catch minor traps in code during writing than after committing/pushing. This project contains a number of Checks that can help program engineers to write code in a uniform style, which makes it easier for the whole team of programmers to review the code, also significantly improves the low threshold of understanding for new developers.

This project is additional(non-standard) checks for Checkstyle that are compiled as extension to maven-checkstyle-plugin, Sonar Checkstyle Plugin, CheckStyle-IDEA, Checkstyle Eclipse plugin, see Distribution chapter for more details.
See Javadoc pages for documentation of Check option.

This project is incubator for Checkstyle checks that are not present in main stream of Checkstyle project.
If you have a check and need place to be build-in, let us know.
If you want to study Java(with mentoring) and help us develop some Checks let us know,
we are looking for new maintainers and level of Java experience does not matter.

We offer diversity of nonstandard Checks and each developer's group chooses what to use to satisfy their code-standard needs.

Release 1.21.1 (15/Oct/2016)

update for sevntu-checkstyle-idea-extension - Idea Extension is incorrectly build by maven. Done by KTannenberg. More

update for ForbidCertainImportsCheck - Fix violation message of ForbidCertainImportsCheck. Done by MEZk. More

Release 1.21.0 (08/June/2016)

new UniformEnumValueCheck - Check forces enum values to match one of the specified patterns and forces all the values to follow only one of the specified patterns.
. Done by Pavel Baranchikov. More

new javadoc for all Checks - Fix all javadoc problems in sevntu-checks project. JAVADOC IS HERE. Done by Daniil Yaroslavtsev and Roman Ivanov. More

update for ConstructorWithoutParamsCheck - Udpdate the default config in ConstructorWithoutParamsCheck. Done by zerg-junior. More

Release 1.20.0 (25/March/2016)

new ConstructorWithoutParamsCheck - This check prohibits usage of parameterless constructors, including the default ones. Rationale: constructors of certain classes must always take arguments to properly instantiate objects. Done by Sergey Dudoladov. More

Release 1.13.2 (7/June/2015)

Release 1.13.1 (6/June/2015)

bug - PublicReferenceToPrivateTypeCheck fails on all files in eclipse-cs. Done by Roman Ivanov.
More

Release 1.13.0 (16/May/2015)

VariableDeclarationUsageDistanceCheck - was moved to Checkstyle library. Done by Roamn Ivanov.

AbbreviationAsWordInNameCheck - was moved to Checkstyle library. Done by Roamn Ivanov.

NEW RequiredParameterForAnnotationCheck - Check that annotation is used with all required parameters. Done by Andrew Uljanenko.
More

NEW UselessSuperCtorCallCheck - Checks for useless "super()" calls in ctors. Done by Zuy Alexey.
More

NEW EmptyPublicCtorInClassCheck - This Check looks for useless empty public constructors. Class constructor is considered useless by this Check if and only if class has exactly one ctor, which is public, empty (one that has no statements) and default. Done by Zuy Alexey.
More

NEW NameConventionForJunit4TestClassesCheck - This check verifies the name of JUnit4 test class for compliance with user defined naming convention. Done by Zuy Alexey.
More

NEW UselessSingleCatchCheck - Checks for the presence of useless single catch blocks. Catch block can be considered useless if it is the only catch block for try, contains only one statement which rethrows catched exception. Done by Zuy Alexey.
More

NEW AvoidConditionInversion - This Check helps to catch condition inversion cases which could be rewritten in a more readable manner. Done by Alexey Kravin.
More

NEW NestedSwitchCheck - Checking if there is no switch block inside other switch block. Done by Damian Szczepanik.
More

Release 1.12.0 (9/Oct/2014)

Update in ForbidThrowAnonymousExceptionsCheck - Reduced ForbidThrowAnonymousExceptionsCheck's limitation. Now this Check puts violation on throwing anonymous exception even in case if it is defined before throwing. Done by Alexey Nesterenko.
More

Update in LineLengthCheck - Updated LineLengthCheck to print the current line length in it's warnings. Done by Alexey Nesterenko.
More

DiamondOperatorForVariableDefinitionCheck - This Check highlights variable definition statements where diamond operator could be used. Done by Alexey Nesterenko.
More

PublicReferenceToPrivateTypeCheck - This Check warns on propagation of inner private types to outer classes:- Externally accessible method if it returns private inner type.- Externally accessible field if it's type is a private inner type.These types could be private inner classes, interfaces or enumerations. Done by Alexey Nesterenko.
More

TernaryPerExpressionCountCheck - Replaced existing NestedTernaryCheck with more general TernaryPerExpressionCountCheck.
New Check provides options to ignore ternary sequences with explicitly set priority level (expressions in braces) and also to force Check to ignore ternary operators which are isolated inside a single line.
Done by Alexey Nesterenko.
More

Update in CustomDeclarationOrderCheck - Updated Check to treat more king of methods as setters. E.g., now Check treats 'set' method as setter, in cases like:

Release 1.11.0 (7/May/2014)

Update for CustomDeclarationOrderCheck - New macros for Fields with assigning to Anonymous classes, macros for Setter/Geter, macros for nested interfaces and nested enumarations
macros for "main()" method. Done by Baratali Izmailov.
More

Release 1.10.0 (24/Nov/2013)

New project!sevntu-checkstyle-sonar-plugin - Project was created as extension to Sonar Checkstyle Plugin for SonarQube™, How to use it is described here in detail and pictures, Done by Ruslan Diachenko. More.

New project!sevntu-checkstyle-idea-extension - Project was created as extension for Checkstyle IDEA plugin for IntelliJ IDEA, How to use it is described here in details and pictures, Done by Vadim Panasiuk. More.

Update for CustomDeclarationOrderCheck - Inner Classes in methods are ignored. Done by Baratali Izmailov.
More

Update in VariableDeclarationUsageDistanceCheck - Update to support block constructions/builders and methods with long list arguments,Done by Baratali Izmailov.
More

Update in ConfusingConditionCheck - Update to skip alarming on sequentional IF, Done by Vadim Panasiuk.
More

Update in NoNullForCollectionReturnCheck - Fix for NullPointerException,Done by Ilja Dubinin.
More

Update in ForbidCertainImportsCheck - additional field as Regexp for excluding imports from checking,Done by Daniil Yaroslavtsev.
More

Release 1.9.0 (18/Sept/2013)

AvoidConstantAsFirstOperandInConditionCheck - Avoid Constant As First Operand In Condition. If comparing values, C(C++) developers prefer to put the constant first in the equality check, to prevent situations of assignment rather than equality checking. But in Java, in IF condition it is impossible to use assignment, so that habit become unnecessary and do damage readability of code.
Example:if (null == varialble)" should be if (varialble == null)"Done by Sergey Burtsev.
More

EitherLogOrThrowException - Either log the exception, or throw it, but never do both. Logging and throwing results in multiple log messages for a single problem in the code, and makes problems for the support engineer who is trying to dig through the logs. This is one of the most annoying error-handling antipatterns.
Example:
catch (NoSuchMethodException e) {
LOG.error("Blah", e);
throw e;
}
Done by Baratali Izmailov.
More

ForbidWildcardAsReturnTypeCheck - Do not use wildcard types as return
types. Rather than providing additional flexibility for your users, it would force
them to use wildcard types in client code.
Properly used, wildcard types are nearly invisible to users of a class. They
cause methods to accept the parameters they should accept and reject those they
should reject. If the user of a class has to think about wildcard types, there is
probably something wrong with the class’s API.
Example:public <T> List<? extends T> getValues()Done by Baratali Izmailov.
More

Release 1.5.3 (4/Sept/2012)

Internal release for site generation automation, refactoring of projects structure to be more independend from
main project and ease code managment and ease new developers unserstanding of project, extension for maven plugin was introduced. Done By Ivan Sopov with help of Ilia Dubinin, Dmitry Gridyushko.

Release 1.5.0 (12/Jun/2012)

AvoidDefaultSerializableInInnerClasses - This check prevents the default implementation Serializable interface in
inner classes (Serializable interface are default if methods readObject() or writeObject() are not override in class). Check has option, that allow
implementation only one method, if it true, but if it false - class must implement both methods. For more information read
"Effective Java (2nd edition)" chapter 11, item 74, page 294. Done by Ilia Dubinin.
issue

Release 1.0.5 (14/Apr/2012)

ChildBlockLengthCheck - Length of child block that is more then 90% of parent block is hard to read
in case child block is long(few display screens). Done by Daniil Yaroslavtsev.
issue

AvoidModifiersForTypesCheck - Disallow some set of modifiers (Only 4 types according to Java Spec:static,final, transient, volatile)
for specified types, caused by static for ULCComponents. Done by Daniil Yaroslavtsev.
issue

CauseParameterInExceptionCheck - Exception Design Best Practices : Cause now needed as one the parameter in any custom Exception constructor.
Done by Daniil Yaroslavtsev.
issue

ForbidsCertainImportsCheck - Forbids certain imports usage. Is similar to the useful check in Sonar project.
Done by Daniil Yaroslavtsev.
issue

ForbidInstantiationCheck - Forbids instantiation of certain object types by their full classname.
For example: "java.lang.NullPointerException" will forbid the NPE instantiation.
Done by Daniil Yaroslavtsev.
issue

ReturnCountExtendedCheck - Checks that method/ctor "return" literal count is not greater than
the given value ("maxReturnCount" property). has many useful ignore options.
Done by Daniil Yaroslavtsev.
issue

AbbreviationAsWordInNameCheck - XMLReader should be names like XmlReader.
Issue for ignoring methods with annotation @Override was fixed. Done by Daniil Yaroslavtsev.
issue

IllegalCatchCheck - Options to ignore 1) exact re-throw after logging
2) creation and throw of other Exception base on current exception. Done by Daniil Yaroslavtsev.
issue.

OverridableMethodInConstructorCheck - Do not use protected/public method in C-tor.
Use only private and final. Check all call hierarchy from c-tor to avoid: c-tor -> private -> public/protected.
Done by Daniil Yaroslavtsev. (issue.

ReturnBooleanFromTernary - It is a bad practice to return boolean values from ternary operations.
Just use the value inside branch instead. Done by Ivan Sopov.

ReturnNullInsteadOfBoolean - Arguably it is the matter of style to use Boolean for ternary logic or enum.
And since all the information is in the single file and even in the single method,
I think that checkstyle is capable of doing this. Done by Ivan Sopov.
(issue)