Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing git-diff #40

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions AbstractClassName/Example1/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove from commit this folder and it should be caught

"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/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"/>

<!-- haltOnException is required for exception fixes and reporting of all exceptions -->
<property name="haltOnException" value="false"/>

<!-- BeforeExecutionFileFilters is required for sources of java9 -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$" />
</module>

<module name="TreeWalker">
<module name="AbstractClassName"/>

<!-- usuppress javadoc parsing errors, as we test Check not a parser -->
<module name="SuppressionXpathSingleFilter">
<property name="message" value="Javadoc comment at column \d+ has parse error"/>
</module>
</module>

<!-- as we run on regression even on non-compiled files we need to skip exceptions on them -->
<module name="SuppressionSingleFilter">
<property name="checks" value="Checker"/>
<property name="message" value="Exception occurred while parsing"/>
</module>
</module>
36 changes: 36 additions & 0 deletions AbstractClassName/Example2/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/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"/>

<!-- haltOnException is required for exception fixes and reporting of all exceptions -->
<property name="haltOnException" value="false"/>

<!-- BeforeExecutionFileFilters is required for sources of java9 -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$" />
</module>

<module name="TreeWalker">
<module name="AbstractClassName">
<property name="ignoreModifier" value="true"/>
</module>

<!-- usuppress javadoc parsing errors, as we test Check not a parser -->
<module name="SuppressionXpathSingleFilter">
<property name="message" value="Javadoc comment at column \d+ has parse error"/>
</module>
</module>

<!-- as we run on regression even on non-compiled files we need to skip exceptions on them -->
<module name="SuppressionSingleFilter">
<property name="checks" value="Checker"/>
<property name="message" value="Exception occurred while parsing"/>
</module>
</module>
36 changes: 36 additions & 0 deletions AbstractClassName/Example3/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/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"/>

<!-- haltOnException is required for exception fixes and reporting of all exceptions -->
<property name="haltOnException" value="false"/>

<!-- BeforeExecutionFileFilters is required for sources of java9 -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$" />
</module>

<module name="TreeWalker">
<module name="AbstractClassName">
<property name="ignoreName" value="true"/>
</module>

<!-- usuppress javadoc parsing errors, as we test Check not a parser -->
<module name="SuppressionXpathSingleFilter">
<property name="message" value="Javadoc comment at column \d+ has parse error"/>
</module>
</module>

<!-- as we run on regression even on non-compiled files we need to skip exceptions on them -->
<module name="SuppressionSingleFilter">
<property name="checks" value="Checker"/>
<property name="message" value="Exception occurred while parsing"/>
</module>
</module>
36 changes: 36 additions & 0 deletions AbstractClassName/Example4/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/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"/>

<!-- haltOnException is required for exception fixes and reporting of all exceptions -->
<property name="haltOnException" value="false"/>

<!-- BeforeExecutionFileFilters is required for sources of java9 -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$" />
</module>

<module name="TreeWalker">
<module name="AbstractClassName">
<property name="format" value="^Generator.+$"/>
</module>

<!-- usuppress javadoc parsing errors, as we test Check not a parser -->
<module name="SuppressionXpathSingleFilter">
<property name="message" value="Javadoc comment at column \d+ has parse error"/>
</module>
</module>

<!-- as we run on regression even on non-compiled files we need to skip exceptions on them -->
<module name="SuppressionSingleFilter">
<property name="checks" value="Checker"/>
<property name="message" value="Exception occurred while parsing"/>
</module>
</module>
5 changes: 3 additions & 2 deletions extractor/src/main/java/com/example/extractor/Main.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.example.extractor;

import java.nio.file.*;
Expand Down Expand Up @@ -27,7 +28,7 @@ public static void main(String[] args) throws Exception {
String inputDirectory = checkstyleRepoPath + "/" + pathInRepo;

System.out.println("PROJECT_ROOT: " + PROJECT_ROOT);
Path outputDirectory = PROJECT_ROOT.resolve("AbbreviationAsWordInName");
Path outputDirectory = PROJECT_ROOT.resolve("AbstractClassName");

// Process files in the input directory and save results to the output directory
processFiles(inputDirectory, outputDirectory.toString());
Expand Down Expand Up @@ -103,4 +104,4 @@ private static void processFile(String exampleFile, Path outputPath) {
e.printStackTrace();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class MainsLauncherTest {
@Test
public void testMain() throws Exception {
// Define the path in repo you want to test
String pathInRepo = "src/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/naming/abbreviationaswordinname";
String pathInRepo = "src/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/naming/abstractclassname";

// Pass the path as an argument
Main.main(new String[]{pathInRepo});
Expand Down
Loading