Skip to content

Instantly share code, notes, and snippets.

View timurt's full-sized avatar

Timur Tibeyev timurt

View GitHub Profile
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name = "Checker">
<property name="charset" value="UTF-8"/>
<!-- do not change severity to 'error', as that will hide errors caused by exceptions -->
<property name="severity" value="warning"/>
@timurt
timurt / IdeaInspectionsSuppressionBug.java
Last active September 5, 2017 17:28
idea inspections suppression bug
package com.puppycrawl.tools.checkstyle.api;
/**
* @noinspection ConstructorWithTooManyParameters, ClassIndependentOfModule, InstanceVariableNamingConvention
*/
public class IdeaInspectionsSuppressionBug {
private final String f;
private final String f1;
private final String f2;
@timurt
timurt / report.md
Last active August 29, 2017 14:02
GSoC 2017 Report

Timur Tibeyev, Google Summer of Code 2017, Final Report

Project idea:

https://github.com/checkstyle/checkstyle/wiki/Checkstyle-GSoC-2017-Project-Ideas#project-name-flexible-suppression-model

Idea of the project is to propose new suppression model. Checkstyle already has suppression model based on line and column numbers. The main disadvantage of the current model - it is hard to support legacy code. As core developers say: "The only thing that prevents users from using Checkstyle is that it requires huge and unavoidable code refactoring at the beginning". New suppression model should be flexible enough to work with legacy and newly written code. New model should be based on Abstract Syntax Tree.

diff --git a/build-config/src/main/resources/checkstyle.xml b/build-config/src/main/resources/checkstyle.xml
index 20161e0..0800561 100644
--- a/build-config/src/main/resources/checkstyle.xml
+++ b/build-config/src/main/resources/checkstyle.xml
@@ -164,8 +164,7 @@
<property name="message" value="Nobody should be using StringBuffer anymore" />
</module>
- <!-- Required to get SuppressionCommentFilter to work -->
- <module name="FileContentsHolder" />
diff --git a/checkstyle-tester/checks-nonjavadoc-error.xml b/checkstyle-tester/checks-nonjavadoc-error.xml
index b60dff5..6b6e06e 100644
--- a/checkstyle-tester/checks-nonjavadoc-error.xml
+++ b/checkstyle-tester/checks-nonjavadoc-error.xml
@@ -409,7 +409,6 @@
</module>
<module name="CommentsIndentation"/>
<module name="DescendantToken"/>
- <module name="FileContentsHolder"/>
<module name="FinalParameters">
diff --git a/pgjdbc/src/main/checkstyle/checks.xml b/pgjdbc/src/main/checkstyle/checks.xml
index 9f25268..a4a2822 100644
--- a/pgjdbc/src/main/checkstyle/checks.xml
+++ b/pgjdbc/src/main/checkstyle/checks.xml
@@ -22,11 +22,6 @@
<property name="fileExtensions" value="java, properties, xml"/>
- <module name="SuppressionCommentFilter">
- <property name="offCommentFormat" value="CHECKSTYLE: OFF"/>
diff --git a/checkstyle.xml b/checkstyle.xml
index c37d8dc..57ba71d 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -71,31 +71,30 @@
PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
SR_ASSIGN, STAR, STAR_ASSIGN"/>
</module>
- <module name="FileContentsHolder"/>
+ <module name="SuppressionCommentFilter">