diff --git a/.ci/validation.sh b/.ci/validation.sh
index c96ae3eebf5..d2802a97b28 100755
--- a/.ci/validation.sh
+++ b/.ci/validation.sh
@@ -216,17 +216,12 @@ no-error-pmd)
echo "CS_version: ${CS_POM_VERSION}"
mvn -e --no-transfer-progress clean install -Pno-validations
echo "Checkout target sources ..."
- # checkout_from "https://github.com/pmd/build-tools.git"
- checkout_from "https://github.com/kkoutsilis/build-tools.git"
+ checkout_from "https://github.com/pmd/build-tools.git"
cd .ci-temp/build-tools/
- git ls-remote
- git checkout "66d""ed33c74662cb3da612f3d34a5ae""fa""a629b443"
mvn -e --no-transfer-progress install
cd ..
- git clone https://github.com/kkoutsilis/pmd.git
+ git clone https://github.com/pmd/pmd.git
cd pmd
- git ls-remote
- git checkout "fa6a862ac8278906d7bcf21852f6552d27a46a73"
./mvnw verify --show-version --errors --batch-mode --no-transfer-progress \
-DskipTests \
-Dmaven.javadoc.skip=true \
diff --git a/.github/workflows/check-pr-description.yml b/.github/workflows/check-pr-description.yml
index f280fd05c9f..7899c9ff62a 100644
--- a/.github/workflows/check-pr-description.yml
+++ b/.github/workflows/check-pr-description.yml
@@ -11,7 +11,7 @@ concurrency:
jobs:
analyze:
name: Analyze
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout repository
diff --git a/.github/workflows/no-old-refs.yml b/.github/workflows/no-old-refs.yml
index f8c33b18bb1..e39f4c351c0 100644
--- a/.github/workflows/no-old-refs.yml
+++ b/.github/workflows/no-old-refs.yml
@@ -21,7 +21,7 @@ concurrency:
jobs:
check_issues:
if: github.repository == 'checkstyle/checkstyle'
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Download checkstyle
uses: actions/checkout@v4
diff --git a/.github/workflows/release-new-milestone-and-issues-in-other-repos.yml b/.github/workflows/release-new-milestone-and-issues-in-other-repos.yml
index 268808b1dab..fb54d946c64 100644
--- a/.github/workflows/release-new-milestone-and-issues-in-other-repos.yml
+++ b/.github/workflows/release-new-milestone-and-issues-in-other-repos.yml
@@ -28,7 +28,7 @@ concurrency:
jobs:
new-milestone-and-issues-in-other-repos:
name: New Milestone, Create issues for ${{ inputs.version }}
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
diff --git a/.github/workflows/release-publish-releasenotes-twitter.yml b/.github/workflows/release-publish-releasenotes-twitter.yml
index 9858e6f0531..bfe16ee8f12 100644
--- a/.github/workflows/release-publish-releasenotes-twitter.yml
+++ b/.github/workflows/release-publish-releasenotes-twitter.yml
@@ -24,7 +24,7 @@ concurrency:
jobs:
publish-releasenotes-twitter:
name: Publish Release Notes on Twitter ${{ inputs.version }}
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
diff --git a/.github/workflows/release-update-github-page.yml b/.github/workflows/release-update-github-page.yml
index a47e8b60110..f4d7139d12f 100644
--- a/.github/workflows/release-update-github-page.yml
+++ b/.github/workflows/release-update-github-page.yml
@@ -24,7 +24,7 @@ concurrency:
jobs:
update-github-page:
name: Update GitHub Page ${{ inputs.version }}
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
permissions:
contents: write
steps:
diff --git a/.github/workflows/release-upload-all-jar.yml b/.github/workflows/release-upload-all-jar.yml
index f3263b0bc96..77e7a6de5f9 100644
--- a/.github/workflows/release-upload-all-jar.yml
+++ b/.github/workflows/release-upload-all-jar.yml
@@ -27,7 +27,7 @@ concurrency:
jobs:
upload-all-jar:
name: Upload '-all' jar ${{ inputs.version }}
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
diff --git a/.github/workflows/releasenotes-gen.yml b/.github/workflows/releasenotes-gen.yml
index 702aa57ca77..2c980329ead 100644
--- a/.github/workflows/releasenotes-gen.yml
+++ b/.github/workflows/releasenotes-gen.yml
@@ -13,7 +13,7 @@ concurrency:
jobs:
generate:
if: github.repository == 'checkstyle/checkstyle'
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Download checkstyle
uses: actions/checkout@v4
diff --git a/.github/workflows/run-link-check.yml b/.github/workflows/run-link-check.yml
index d82b0f1998b..40e5ce011d2 100644
--- a/.github/workflows/run-link-check.yml
+++ b/.github/workflows/run-link-check.yml
@@ -18,7 +18,7 @@ concurrency:
jobs:
check_issues:
if: github.repository == 'checkstyle/checkstyle'
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Download checkstyle
uses: actions/checkout@v4
diff --git a/.github/workflows/set-milestone-on-referenced-issue.yml b/.github/workflows/set-milestone-on-referenced-issue.yml
index 8b7a052a87a..35c701f4338 100644
--- a/.github/workflows/set-milestone-on-referenced-issue.yml
+++ b/.github/workflows/set-milestone-on-referenced-issue.yml
@@ -26,7 +26,7 @@ permissions:
jobs:
set-milestone:
if: github.repository == 'checkstyle/checkstyle'
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml
index edf51c087e1..dd0af5db2f1 100644
--- a/.semaphore/semaphore.yml
+++ b/.semaphore/semaphore.yml
@@ -52,7 +52,10 @@ blocks:
- .ci/validation.sh verify-regexp-id
- .ci/no-exception-test.sh guava-with-google-checks
- .ci/no-exception-test.sh guava-with-sun-checks
- - .ci/validation.sh nondex
+ # until https://github.com/checkstyle/checkstyle/issues/14086
+ # - .ci/no-exception-test.sh no-exception-samples-ant
+ # permanently disabled as it is very unstable in execution
+ # - .ci/validation.sh nondex
# until https://github.com/checkstyle/checkstyle/issues/9807
# - mvn -e --no-transfer-progress clean package -Passembly,no-validations
# && .ci/validation.sh no-violation-test-josm
diff --git a/README.md b/README.md
index bd118f6d7e8..4de424ead7e 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,6 @@
[![][pitest img]][pitest]
[![][checker framework img]][checker framework]
[![][dependabot img]][dependabot]
-[![][sonar img]][sonar]
[![][release notes/version img]][release notes/version]
[![][closed issues img]][closed issues]
[![][link check img]][link check]
@@ -146,9 +145,6 @@ Checkstyle uses libraries:
[appveyor]:https://ci.appveyor.com/project/checkstyle/checkstyle/history
[appveyor img]:https://ci.appveyor.com/api/projects/status/rw6bw3dl9kph6ucc?svg=true
-[sonar]:https://sonarcloud.io/dashboard?id=org.checkstyle%3Acheckstyle
-[sonar img]:https://sonarcloud.io/api/project_badges/measure?project=org.checkstyle%3Acheckstyle&metric=sqale_index
-
[coverage]:https://codecov.io/github/checkstyle/checkstyle?branch=master
[coverage img]:https://codecov.io/github/checkstyle/checkstyle/coverage.svg?branch=master
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index cf323331cac..897d0849136 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -20,74 +20,74 @@ strategy:
matrix:
# testing age of pr
'pr-age':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh pr-age"
skipCache: true
# spelling
'spelling':
- image: 'ubuntu-22.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/test-spelling-unknown-words.sh"
skipCache: true
# unit tests (openjdk11)
'test':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test"
# unit tests in German locale (openjdk11)
'test-de':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-de"
# unit tests in Spanish locale (openjdk11)
'test-es':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-es"
# unit tests in Finnish locale (openjdk11)
'test-fi':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-fi"
# unit tests in French locale (openjdk11)
'test-fr':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-fr"
# unit tests in Chinese locale (openjdk11)
'test-zh':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-zh"
# unit tests in Japanese locale (openjdk11)
'test-ja':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-ja"
# unit tests in Portuguese locale (openjdk11)
'test-pt':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-pt"
# unit tests in Turkish locale (openjdk11)
'test-tr':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-tr"
# unit tests in Russian locale (openjdk11)
'test-ru':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-ru"
# unit tests in Albanian locale (openjdk11)
'test-al':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh test-al"
# OpenJDK11 verify
'OpenJDK11 verify':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "mvn -e --no-transfer-progress verify"
# MacOS JDK11 verify
@@ -100,17 +100,9 @@ strategy:
image: 'macOS-14'
cmd: "JAVA_HOME=$JAVA_HOME_17_X64 mvn -e --no-transfer-progress verify"
- # moved back to Travis till we find a way to keep secrets in azure
- # ensure that all modules are used in no exception configs
- # 'verify-no-exception-configs':
- # image: 'ubuntu-20.04'
- # cmd: "./.ci/validation.sh verify-no-exception-configs"
- # skipCache: true
- # needXmlstarlet: true
-
# versions to update
'versions':
- image: 'ubuntu-20.04'
+ image: 'ubuntu-24.04'
cmd: "./.ci/validation.sh versions"
onCronOnly: true
diff --git a/config/checker-framework-suppressions/checker-formatter-suppressions.xml b/config/checker-framework-suppressions/checker-formatter-suppressions.xml
index 345a6aa9855..0a475701581 100644
--- a/config/checker-framework-suppressions/checker-formatter-suppressions.xml
+++ b/config/checker-framework-suppressions/checker-formatter-suppressions.xml
@@ -7,20 +7,6 @@
GWT emulated source tag should be preceded with an empty line.'
boolean emulated() {
return false;
}
@@ -136,9 +135,6 @@ class InnerPrecedingPtag {
* tag should be placed immediately before the first word'
- // ' tag should be preceded with an empty line.'
public void foo() {}
// 2 violations 6 lines below:
diff --git a/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/InputIncorrectJavadocParagraph.java b/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/InputIncorrectJavadocParagraph.java
index d110e44e6f1..874750e8c00 100644
--- a/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/InputIncorrectJavadocParagraph.java
+++ b/src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/InputIncorrectJavadocParagraph.java
@@ -116,9 +116,6 @@ boolean emulated() {
*
* @see Documentation about GWT emulated source tag should be placed immediately before the first word'
- // ' tag should be preceded with an empty line.'
boolean emulated() {
return false;
}
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java b/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java
index 2625609d2a0..a1b05efbfd5 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java
@@ -21,7 +21,6 @@
import java.io.File;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser.ParseErrorMessage;
import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser.ParseStatus;
@@ -169,8 +168,7 @@ private static String getIndentation(DetailNode node) {
* @throws IOException if the file could not be read.
*/
private static DetailNode parseFile(File file) throws IOException {
- final FileText text = new FileText(file.getAbsoluteFile(),
- System.getProperty("file.encoding", StandardCharsets.UTF_8.name()));
+ final FileText text = new FileText(file, System.getProperty("file.encoding"));
return parseJavadocAsDetailNode(text.getFullText().toString());
}
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java b/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java
index c2a0d6095e3..0840459360c 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java
@@ -19,13 +19,13 @@
package com.puppycrawl.tools.checkstyle;
+import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.stream.Collectors;
import org.antlr.v4.runtime.BufferedTokenStream;
@@ -1593,7 +1593,7 @@ public DetailAstImpl visitBinOp(JavaLanguageParser.BinOpContext ctx) {
// operation
final Queue Example: Example: Example AST: Example: Example:
To configure the check to set allowed distance:
To configure the check to ignore certain variables:
To configure the check to force validation between scopes:
To configure the check to check final variables:
The distance for the variable "minutes" is 6 because there is one more expression
(except the initialization block) between the declaration of this variable and its usage.
- {@code
+ * <body>
+ * <p>Body Content</p>
+ * </body>
+ * }
+ * Tree:
+ *
+ * {@code
+ * HTML_ELEMENT -> HTML_ELEMENT
+ * `--BODY -> BODY
+ * |--BODY_TAG_START -> BODY_TAG_START
+ * | |--START -> <
+ * | |--BODY_HTML_TAG_NAME -> body
+ * | `--END -> >
+ * |--NEWLINE -> \r\n
+ * |--LEADING_ASTERISK -> *
+ * |--TEXT ->
+ * |--PARAGRAPH -> PARAGRAPH
+ * | |--P_TAG_START -> P_TAG_START
+ * | | |--START -> <
+ * | | |--P_HTML_TAG_NAME -> p
+ * | | `--END -> >
+ * | |--TEXT -> Body Content
+ * | `--P_TAG_END -> P_TAG_END
+ * | |--START -> <
+ * | |--SLASH -> /
+ * | |--P_HTML_TAG_NAME -> p
+ * | `--END -> >
+ * |--NEWLINE -> \r\n
+ * |--LEADING_ASTERISK -> *
+ * |--TEXT ->
+ * `--BODY_TAG_END -> BODY_TAG_END
+ * |--START -> <
+ * |--SLASH -> /
+ * |--BODY_HTML_TAG_NAME -> body
+ * `--END -> >
+ * }
+ *
+ *
+ * @see
+ *
+ * comments are written in HTML
+ * @see #BODY_HTML_TAG_NAME
+ */
public static final int BODY_HTML_TAG_NAME = JavadocParser.BODY_HTML_TAG_NAME;
/**
@@ -1507,7 +1554,63 @@ public final class JavadocTokenTypes {
*/
public static final int DT_HTML_TAG_NAME = JavadocParser.DT_HTML_TAG_NAME;
- /** Head tag name. */
+ /**
+ * Head tag name.
+ *
+ * {@code
+ * <head>
+ * <title>Page Title</title>
+ * <meta charset="UTF-8">
+ * </head>
+ * }
+ * Tree:
+ * {@code
+ * HEAD -> HEAD
+ * |--HEAD_TAG_START -> HEAD_TAG_START
+ * | |--START -> <
+ * | |--HEAD_HTML_TAG_NAME -> head
+ * | `--END -> >
+ * |--NEWLINE -> \r\n
+ * |--LEADING_ASTERISK -> *
+ * |--TEXT ->
+ * |--HTML_TAG -> HTML_TAG
+ * | |--HTML_ELEMENT_START -> HTML_ELEMENT_START
+ * | | |--START -> <
+ * | | |--HTML_TAG_NAME -> title
+ * | | `--END -> >
+ * | |--TEXT -> Page Title
+ * | `--HTML_ELEMENT_END -> HTML_ELEMENT_END
+ * | |--START -> <
+ * | |--SLASH -> /
+ * | |--HTML_TAG_NAME -> title
+ * | `--END -> >
+ * |--NEWLINE -> \r\n
+ * |--LEADING_ASTERISK -> *
+ * |--TEXT ->
+ * |--SINGLETON_ELEMENT -> SINGLETON_ELEMENT
+ * | `--META_TAG -> META_TAG
+ * | |--START -> <
+ * | |--META_HTML_TAG_NAME -> meta
+ * | |--WS ->
+ * | |--ATTRIBUTE -> ATTRIBUTE
+ * | | |--HTML_TAG_NAME -> charset
+ * | | |--EQUALS -> =
+ * | | `--ATTR_VALUE -> "UTF-8"
+ * | `--END -> >
+ * |--NEWLINE -> \r\n
+ * |--LEADING_ASTERISK -> *
+ * |--TEXT ->
+ * `--HEAD_TAG_END -> HEAD_TAG_END
+ * |--START -> <
+ * |--SLASH -> /
+ * |--HEAD_HTML_TAG_NAME -> head
+ * `--END -> >
+ * }
+ *
+ *
+ * @see #HEAD_HTML_TAG_NAME
+ */
public static final int HEAD_HTML_TAG_NAME = JavadocParser.HEAD_HTML_TAG_NAME;
/** Html tag name. */
@@ -2282,14 +2385,14 @@ public final class JavadocTokenTypes {
* | |--SLASH -> /
* | |--BODY_HTML_TAG_NAME -> body
* | `--END -> >
- * |--NEWLINE -> \n
- * |--LEADING_ASTERISK -> *
- * |--TEXT -> /
- * |--NEWLINE -> \n
- * |--TEXT -> public class Test {
- * |--NEWLINE -> \n
- * |--TEXT -> }
- * |--NEWLINE -> \n
+ * |--NEWLINE -> \n
+ * |--LEADING_ASTERISK -> *
+ * |--TEXT -> /
+ * |--NEWLINE -> \n
+ * |--TEXT -> public class Test {
+ * |--NEWLINE -> \n
+ * |--TEXT -> }
+ * |--NEWLINE -> \n
* }
*
*/
@@ -2442,7 +2545,28 @@ public final class JavadocTokenTypes {
/** End description of a term tag. */
public static final int DD_TAG_END = JavadocParser.RULE_ddTagEnd + RULE_TYPES_OFFSET;
- /** Description term html tag: {@code }. */
+ /**
+ * DT html tag.
+ *
+ * {@code
+ * {@code
+ * --HTML_ELEMENT -> HTML_ELEMENT
+ * `--DT -> DT
+ * |--DT_TAG_START -> DT_TAG_START
+ * | |--START -> <
+ * | |--DT_HTML_TAG_NAME -> dt
+ * | `--END -> >
+ * |--TEXT -> "Description term"
+ * `--DT_TAG_END -> DT_TAG_END
+ * |--START -> <
+ * |--SLASH -> /
+ * |--DT_HTML_TAG_NAME -> dt
+ * `--END -> >
+ * }
+ *
+ */
public static final int DT = JavadocParser.RULE_dt + RULE_TYPES_OFFSET;
/** Start description term tag. */
public static final int DT_TAG_START = JavadocParser.RULE_dtTagStart + RULE_TYPES_OFFSET;
@@ -2625,7 +2749,34 @@ public final class JavadocTokenTypes {
/** Basefont html tag. */
public static final int BASEFONT_TAG = JavadocParser.RULE_basefontTag + RULE_TYPES_OFFSET;
- /** Br html tag. */
+ /**
+ * Br html tag.
+ *
+ * {@code
+ * Tree:
+ *
line breaks
}
+ * {@code
+ * JAVADOC -> JAVADOC
+ * |--NEWLINE -> \r\n
+ * |--LEADING_ASTERISK -> *
+ * |--TEXT ->
+ * |--HTML_ELEMENT -> HTML_ELEMENT
+ * | `--SINGLETON_ELEMENT -> SINGLETON_ELEMENT
+ * | `--BR_TAG -> BR_TAG
+ * | |--START -> <
+ * | |--BR_HTML_TAG_NAME -> br
+ * | `--END -> >
+ * |--TEXT -> line breaks
+ * |--HTML_ELEMENT -> HTML_ELEMENT
+ * | `--SINGLETON_ELEMENT -> SINGLETON_ELEMENT
+ * | `--BR_TAG -> BR_TAG
+ * | |--START -> <
+ * | |--BR_HTML_TAG_NAME -> br
+ * | `--SLASH_END -> />
+ * }
+ *
+ */
public static final int BR_TAG = JavadocParser.RULE_brTag + RULE_TYPES_OFFSET;
/** Col html tag. */
@@ -2743,7 +2894,50 @@ public final class JavadocTokenTypes {
*/
public static final int INPUT_TAG = JavadocParser.RULE_inputTag + RULE_TYPES_OFFSET;
- /** Isindex html tag. */
+ /**
+ * Isindex tag name.
+ *
+ * {@code
+ * <head>
+ * <isindex prompt="search">
+ * </head>
+ * }
+ * Tree:
+ *
+ * {@code
+ * |--HTML_ELEMENT -> HTML_ELEMENT
+ * | `--HEAD -> HEAD
+ * | |--HEAD_TAG_START -> HEAD_TAG_START
+ * | | |--START -> <
+ * | | |--HEAD_HTML_TAG_NAME -> head
+ * | | `--END -> >
+ * | |--NEWLINE -> \r\n
+ * | |--LEADING_ASTERISK -> *
+ * | |--TEXT ->
+ * | |--SINGLETON_ELEMENT -> SINGLETON_ELEMENT
+ * | | `--ISINDEX_TAG -> ISINDEX_TAG
+ * | | |--START -> <
+ * | | |--ISINDEX_HTML_TAG_NAME -> isindex
+ * | | |--WS ->
+ * | | |--ATTRIBUTE -> ATTRIBUTE
+ * | | | |--HTML_TAG_NAME -> prompt
+ * | | | |--EQUALS -> =
+ * | | | `--ATTR_VALUE -> "search"
+ * | | `--END -> >
+ * | |--NEWLINE -> \r\n
+ * | |--LEADING_ASTERISK -> *
+ * | |--TEXT ->
+ * | `--HEAD_TAG_END -> HEAD_TAG_END
+ * | |--START -> <
+ * | |--SLASH -> /
+ * | |--HEAD_HTML_TAG_NAME -> head
+ * | `--END -> >
+ * |--NEWLINE -> \r\n
+ * |--TEXT ->
+ * }
+ *
+ */
public static final int ISINDEX_TAG = JavadocParser.RULE_isindexTag + RULE_TYPES_OFFSET;
/** Link html tag. */
@@ -2783,9 +2977,37 @@ public final class JavadocTokenTypes {
public static final int PARAM_TAG = JavadocParser.RULE_paramTag + RULE_TYPES_OFFSET;
/**
- * HTML void element {@code
To configure the check to set allowed distance:
@@ -91,7 +91,7 @@ cal.set(Calendar.MINUTE, minutes); - +To configure the check to ignore certain variables:
@@ -108,7 +108,7 @@ cal.set(Calendar.MINUTE, minutes); - +To configure the check to force validation between scopes:
@@ -122,7 +122,7 @@ cal.set(Calendar.MINUTE, minutes); - +To configure the check to check final variables:
diff --git a/src/site/xdoc/checks/design/designforextension.xml b/src/site/xdoc/checks/design/designforextension.xml index 2a2282a4c41..599febef512 100644 --- a/src/site/xdoc/checks/design/designforextension.xml +++ b/src/site/xdoc/checks/design/designforextension.xml @@ -204,8 +204,7 @@ public abstract class Example1 { return ""; } } - - +To configure the check to allow methods which have @Override annotations to be designed for extension. @@ -256,8 +255,7 @@ public abstract class Example2 { return ""; } } - - +
To configure the check to allow methods which contain a specified comment text pattern in their javadoc to be designed for extension. @@ -308,8 +306,7 @@ public abstract class Example3 { return ""; } } - - +
To configure the check to allow methods which contain a specified comment text pattern in their javadoc which can span multiple lines to be designed for extension. diff --git a/src/site/xdoc/checks/design/designforextension.xml.template b/src/site/xdoc/checks/design/designforextension.xml.template index 2fda56d771e..1cf6ae472ab 100644 --- a/src/site/xdoc/checks/design/designforextension.xml.template +++ b/src/site/xdoc/checks/design/designforextension.xml.template @@ -151,8 +151,7 @@ public abstract class Plant { - - +
To configure the check to allow methods which have @Override annotations to be designed for extension. @@ -167,8 +166,7 @@ public abstract class Plant { - - +
To configure the check to allow methods which contain a specified comment text pattern in their javadoc to be designed for extension. @@ -183,8 +181,7 @@ public abstract class Plant { - - +
To configure the check to allow methods which contain a specified comment text pattern in their javadoc which can span multiple lines to be designed for extension. diff --git a/src/site/xdoc/checks/design/hideutilityclassconstructor.xml b/src/site/xdoc/checks/design/hideutilityclassconstructor.xml index 2eb56167af8..9c71eea9e19 100644 --- a/src/site/xdoc/checks/design/hideutilityclassconstructor.xml +++ b/src/site/xdoc/checks/design/hideutilityclassconstructor.xml @@ -115,8 +115,7 @@ class Application1 { public static void main(String[] args) { } } - - +
To configure the check to ignore classes annotated with SpringBootApplication
or java.lang.Deprecated
.
diff --git a/src/site/xdoc/checks/design/hideutilityclassconstructor.xml.template b/src/site/xdoc/checks/design/hideutilityclassconstructor.xml.template
index c0bea4ac61d..a0d0615c8c2 100644
--- a/src/site/xdoc/checks/design/hideutilityclassconstructor.xml.template
+++ b/src/site/xdoc/checks/design/hideutilityclassconstructor.xml.template
@@ -65,8 +65,7 @@ public class StringUtils // not final to allow subclassing
-
-
+
To configure the check to ignore classes annotated with SpringBootApplication
or java.lang.Deprecated
.
diff --git a/src/site/xdoc/checks/design/interfaceistype.xml b/src/site/xdoc/checks/design/interfaceistype.xml
index e7810c76ff3..7bc1e6e7b0d 100644
--- a/src/site/xdoc/checks/design/interfaceistype.xml
+++ b/src/site/xdoc/checks/design/interfaceistype.xml
@@ -79,7 +79,7 @@ class Example1 {
void test();
}
}
-
+
To configure the check to report violation so that it doesn't allow Marker Interfaces:
diff --git a/src/site/xdoc/checks/design/interfaceistype.xml.template b/src/site/xdoc/checks/design/interfaceistype.xml.template index 7dfb9202a7f..790ba1166e3 100644 --- a/src/site/xdoc/checks/design/interfaceistype.xml.template +++ b/src/site/xdoc/checks/design/interfaceistype.xml.template @@ -52,7 +52,7 @@ - +To configure the check to report violation so that it doesn't allow Marker Interfaces:
diff --git a/src/site/xdoc/checks/design/mutableexception.xml b/src/site/xdoc/checks/design/mutableexception.xml index 57f92d9957f..4ade7419f58 100644 --- a/src/site/xdoc/checks/design/mutableexception.xml +++ b/src/site/xdoc/checks/design/mutableexception.xml @@ -107,8 +107,7 @@ class FirstBadException extends java.lang.Exception { this.code = code; } } - - +To configure the check so that it checks for class name that ends with 'Exception': @@ -157,8 +156,7 @@ class SecondBadException extends java.lang.Exception { this.code = code; } } - - +
To configure the check so that it checks for type name that is used in 'extends' and ends with 'Throwable': diff --git a/src/site/xdoc/checks/design/mutableexception.xml.template b/src/site/xdoc/checks/design/mutableexception.xml.template index 39f1acea934..c6de56537dc 100644 --- a/src/site/xdoc/checks/design/mutableexception.xml.template +++ b/src/site/xdoc/checks/design/mutableexception.xml.template @@ -56,8 +56,7 @@ - - +
To configure the check so that it checks for class name that ends with 'Exception': @@ -72,8 +71,7 @@ - - +
To configure the check so that it checks for type name that is used in 'extends' and ends with 'Throwable': diff --git a/src/site/xdoc/checks/design/onetoplevelclass.xml b/src/site/xdoc/checks/design/onetoplevelclass.xml index 0809969e78f..22ad562a69f 100644 --- a/src/site/xdoc/checks/design/onetoplevelclass.xml +++ b/src/site/xdoc/checks/design/onetoplevelclass.xml @@ -45,7 +45,7 @@ public class Example1 { // OK, first top-level class class ViolationExample1 { // violation, "has to reside in its own source file." // methods } - +
An example of code without public top-level type:
@@ -57,7 +57,7 @@ class Example2 { // OK, first top-level class class ViolationExample2 { // violation, "has to reside in its own source file." // methods } - +An example of code without violations:
diff --git a/src/site/xdoc/checks/design/onetoplevelclass.xml.template b/src/site/xdoc/checks/design/onetoplevelclass.xml.template index a6fc7c660c0..919781fc5b7 100644 --- a/src/site/xdoc/checks/design/onetoplevelclass.xml.template +++ b/src/site/xdoc/checks/design/onetoplevelclass.xml.template @@ -39,7 +39,7 @@ - +An example of code without public top-level type:
@@ -47,7 +47,7 @@ - +An example of code without violations:
diff --git a/src/site/xdoc/checks/design/throwscount.xml b/src/site/xdoc/checks/design/throwscount.xml index 42b292e2d15..dd827517c29 100644 --- a/src/site/xdoc/checks/design/throwscount.xml +++ b/src/site/xdoc/checks/design/throwscount.xml @@ -104,7 +104,7 @@ public class Example1 { NullPointerException { } } - +To configure the check so that it doesn't allow more than two throws per method: @@ -147,7 +147,7 @@ public class Example2 { NullPointerException { } } - +
To configure the check so that it doesn't skip private methods:
diff --git a/src/site/xdoc/checks/design/throwscount.xml.template b/src/site/xdoc/checks/design/throwscount.xml.template index 9d47e8e5c57..6c950615b83 100644 --- a/src/site/xdoc/checks/design/throwscount.xml.template +++ b/src/site/xdoc/checks/design/throwscount.xml.template @@ -61,7 +61,7 @@ - +To configure the check so that it doesn't allow more than two throws per method: @@ -78,7 +78,7 @@ - +
To configure the check so that it doesn't skip private methods:
diff --git a/src/site/xdoc/checks/design/visibilitymodifier.xml b/src/site/xdoc/checks/design/visibilitymodifier.xml index da8a15faab8..2c5b254ac01 100644 --- a/src/site/xdoc/checks/design/visibilitymodifier.xml +++ b/src/site/xdoc/checks/design/visibilitymodifier.xml @@ -192,7 +192,7 @@ class Example1 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +To configure the check so that it allows package visible members:
@@ -245,7 +245,7 @@ class Example2 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +To configure the check so that it allows protected visible members:
@@ -299,7 +299,7 @@ class Example3 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +To configure the check so that it allows no public members:
@@ -354,7 +354,7 @@ class Example4 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +To configure the Check so that it allows public immutable fields (mostly for immutable classes): @@ -409,7 +409,7 @@ class Example5 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +
To configure the Check in order to allow user specified immutable class names:
@@ -466,7 +466,7 @@ class Example6 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +Note, if allowPublicImmutableFields is set to true, the check will also check whether generic type parameters are immutable. If at least one generic type parameter is mutable, @@ -525,7 +525,7 @@ class Example7 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +
To configure the Check passing fields annotated with @java.lang.Deprecated:
@@ -580,8 +580,7 @@ class Example8 { // violation below, annotation not configured 'must be private' public String testString = ""; } - - +To configure the Check passing fields annotated with @org.junit.Rule, @org.junit.ClassRule and @com.google.common.annotations.VisibleForTesting annotations: @@ -634,7 +633,7 @@ class Example9 { @com.google.common.annotations.VisibleForTesting public String testString = ""; } - +
To configure the Check passing fields annotated with short annotation name:
@@ -692,7 +691,7 @@ class Example10 {To understand the difference between allowPublicImmutableFields and allowPublicFinalFields options, please, study the following examples. -
+1) To configure the check to use only 'allowPublicImmutableFields' option:
@@ -720,7 +719,7 @@ class Example11 { public final List list = null; // violation 'must be private' } - +2) To configure the check to use only 'allowPublicFinalFields' option:
diff --git a/src/site/xdoc/checks/design/visibilitymodifier.xml.template b/src/site/xdoc/checks/design/visibilitymodifier.xml.template index 10cc894b50a..350bd6e7f6a 100644 --- a/src/site/xdoc/checks/design/visibilitymodifier.xml.template +++ b/src/site/xdoc/checks/design/visibilitymodifier.xml.template @@ -101,7 +101,7 @@ - +To configure the check so that it allows package visible members:
@@ -115,7 +115,7 @@ - +To configure the check so that it allows protected visible members:
@@ -129,7 +129,7 @@ - +To configure the check so that it allows no public members:
@@ -143,7 +143,7 @@ - +To configure the Check so that it allows public immutable fields (mostly for immutable classes): @@ -160,7 +160,7 @@ - +
To configure the Check in order to allow user specified immutable class names:
@@ -176,7 +176,7 @@ - +Note, if allowPublicImmutableFields is set to true, the check will also check whether generic type parameters are immutable. If at least one generic type parameter is mutable, @@ -194,7 +194,7 @@ - +
To configure the Check passing fields annotated with @java.lang.Deprecated:
@@ -210,8 +210,7 @@ - - +To configure the Check passing fields annotated with @org.junit.Rule, @org.junit.ClassRule and @com.google.common.annotations.VisibleForTesting annotations: @@ -228,7 +227,7 @@ - +
To configure the Check passing fields annotated with short annotation name:
@@ -248,7 +247,7 @@To understand the difference between allowPublicImmutableFields and allowPublicFinalFields options, please, study the following examples. -
+1) To configure the check to use only 'allowPublicImmutableFields' option:
@@ -264,7 +263,7 @@ - +2) To configure the check to use only 'allowPublicFinalFields' option:
diff --git a/src/site/xdoc/checks/header/header.xml b/src/site/xdoc/checks/header/header.xml index 315eced9388..ce858ee3d29 100644 --- a/src/site/xdoc/checks/header/header.xml +++ b/src/site/xdoc/checks/header/header.xml @@ -91,8 +91,7 @@ package com.puppycrawl.tools.checkstyle.checks.header.header; // OK, as by default there is not specific header defined to validate it presence public class Example1 { } - - +
To configure the check to use header file "java.header"
and
ignore lines 2
, 3
, and 4
and only process Java
@@ -136,8 +135,7 @@ package com.puppycrawl.tools.checkstyle.checks.header.header;
/* violation on first line 'Line does not match expected header line of' */
// because headerFile is bigger then target java file
public class Example2 { }
-
-
+
Without the need for an external header file:
@@ -154,8 +152,7 @@ public class Example2 { } package com.puppycrawl.tools.checkstyle.checks.header.header; /* violation on first line 'Line does not match expected header' */ public class Example3 { } - - +In case target file is less in size than header file:
diff --git a/src/site/xdoc/checks/header/header.xml.template b/src/site/xdoc/checks/header/header.xml.template index 68d43e118ca..ece5475aa8a 100644 --- a/src/site/xdoc/checks/header/header.xml.template +++ b/src/site/xdoc/checks/header/header.xml.template @@ -51,8 +51,7 @@ - - +
To configure the check to use header file "java.header"
and
ignore lines 2
, 3
, and 4
and only process Java
@@ -76,8 +75,7 @@
-
-
+
Without the need for an external header file:
@@ -91,8 +89,7 @@ - - +In case target file is less in size than header file:
diff --git a/src/site/xdoc/checks/header/regexpheader.xml b/src/site/xdoc/checks/header/regexpheader.xml index 1a80daef7db..b2ad40aa90d 100644 --- a/src/site/xdoc/checks/header/regexpheader.xml +++ b/src/site/xdoc/checks/header/regexpheader.xml @@ -80,8 +80,7 @@ package com.puppycrawl.tools.checkstyle.checks.header.header; // OK, as by default there is not specific header defined to validate it presence public class Example1 { } - - +
To configure the check to use header file "java.header"
and
10
and 13
multi-lines:
@@ -121,8 +120,7 @@ package com.puppycrawl.tools.checkstyle.checks.header.header;
/* violation on first line 'Line does not match expected header line of' */
// because headerFile is bigger then target java file
public class Example2 { }
-
-
+
To configure the check to verify that each file starts with the header @@ -142,8 +140,7 @@ public class Example2 { } package com.puppycrawl.tools.checkstyle.checks.header.regexpheader; /* violation on first line 'Line does not match expected header line' */ public class Example3 { } - - +
For regex containing ".*"
To configure the check to use header file "java.header"
and
10
and 13
multi-lines:
@@ -62,8 +61,7 @@
-
-
+
To configure the check to verify that each file starts with the header @@ -78,8 +76,7 @@ - - +
For regex containing ".*"
To configure the check so that star imports from packages
java.io and java.net
as well as static members from class
@@ -107,7 +107,7 @@ import java.io.*;
import static java.lang.Math.*;
import java.util.*; // violation, 'Using the '.*' form of import should be avoided.'
import java.net.*;
-
+
To configure the check so that star imports from all packages are allowed: @@ -130,7 +130,7 @@ import java.io.*; import static java.lang.Math.*; // violation, 'form of import should be avoided.' import java.util.*; import java.net.*; - +
To configure the check so that starred static member imports from all packages are allowed: @@ -153,7 +153,7 @@ import java.io.*; // violation, 'Using the '.*' form of import should be avoided import static java.lang.Math.*; import java.util.*; // violation, 'Using the '.*' form of import should be avoided.' import java.net.*; // violation, 'Using the '.*' form of import should be avoided.' - +
To configure the check so that star imports from packages
java.io and java.net
are allowed:
@@ -177,7 +177,7 @@ import java.io.*;
import static java.lang.Math.*; // violation, 'form of import should be avoided.'
import java.util.*;
import java.net.*;
-
+
To configure the check so that star imports from packages
java.io and java.net
as well as static members imports
diff --git a/src/site/xdoc/checks/imports/avoidstarimport.xml.template b/src/site/xdoc/checks/imports/avoidstarimport.xml.template
index 1a61667a843..253fc7b9a16 100644
--- a/src/site/xdoc/checks/imports/avoidstarimport.xml.template
+++ b/src/site/xdoc/checks/imports/avoidstarimport.xml.template
@@ -53,7 +53,7 @@
-
+
To configure the check so that star imports from packages
java.io and java.net
as well as static members from class
@@ -71,7 +71,7 @@
-
+
To configure the check so that star imports from all packages are allowed: @@ -88,7 +88,7 @@ - +
To configure the check so that starred static member imports from all packages are allowed: @@ -105,7 +105,7 @@ - +
To configure the check so that star imports from packages
java.io and java.net
are allowed:
@@ -122,7 +122,7 @@
-
+
To configure the check so that star imports from packages
java.io and java.net
as well as static members imports
diff --git a/src/site/xdoc/checks/imports/avoidstaticimport.xml b/src/site/xdoc/checks/imports/avoidstaticimport.xml
index 1de63b8d099..0447d4648e4 100644
--- a/src/site/xdoc/checks/imports/avoidstaticimport.xml
+++ b/src/site/xdoc/checks/imports/avoidstaticimport.xml
@@ -73,7 +73,7 @@ import static java.lang.Math.pow; // violation, 'Using a static member
import static java.lang.System.*; // violation, 'Using a static member import should be avoided.'
import java.io.File; // OK
import java.util.*; // OK
-
+
To configure the check so that the java.lang.System.out
member and all members from java.lang.Math
are allowed:
diff --git a/src/site/xdoc/checks/imports/avoidstaticimport.xml.template b/src/site/xdoc/checks/imports/avoidstaticimport.xml.template
index 295a18ce58e..7da40238ce1 100644
--- a/src/site/xdoc/checks/imports/avoidstaticimport.xml.template
+++ b/src/site/xdoc/checks/imports/avoidstaticimport.xml.template
@@ -58,7 +58,7 @@
-
+
To configure the check so that the java.lang.System.out
member and all members from java.lang.Math
are allowed:
diff --git a/src/site/xdoc/checks/imports/customimportorder.xml b/src/site/xdoc/checks/imports/customimportorder.xml
index d1c85df8ac9..53a68cfc7ac 100644
--- a/src/site/xdoc/checks/imports/customimportorder.xml
+++ b/src/site/xdoc/checks/imports/customimportorder.xml
@@ -194,7 +194,7 @@ import java.time.*;
import static java.io.File.separator;
import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck;
import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck;
-
+
To configure the check so that it checks in the order (static imports,standard java packages,third party package): @@ -223,7 +223,7 @@ import static java.io.File.separator; // violation, 'wrong order' import org.apache.commons.io.FileUtils; import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; - +
To configure the check such that only java packages are included in standard java packages
@@ -253,7 +253,7 @@ import javax.net.*; // violation, 'should be separated' import org.apache.commons.io.FileUtils; // violation, 'Extra separation' import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; - +To configure the check to include only "com" packages as third party group imports: @@ -284,7 +284,7 @@ import javax.net.*; import org.apache.commons.io.FileUtils; // violation, 'should be placed at the end' import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; // violation, 'should be separated' import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; - +
To configure the check to force some packages in special import group:
@@ -314,7 +314,7 @@ import java.time.*; import javax.net.*; import org.apache.commons.io.FileUtils; // violation, 'wrong order' - +To configure the check such that empty line separator between two groups is enabled:
@@ -345,7 +345,7 @@ import javax.net.*; import org.apache.commons.io.FileUtils; // violation, 'should be separated' import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; // violation, 'should be separated' import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; - +To configure the check such that import groups are forced to be sorted alphabetically:
@@ -386,7 +386,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; then "org" and then all other importsNotes:
To configure the check so that it matches default Eclipse formatter configuration (tested on Mars release):
@@ -472,8 +472,7 @@ import org.apache.commons.io.FileUtils; "java", then "javax" and "java"Note: "separated" option is disabled because IDEA default has blank line between "java" and static imports, and no blank line between @@ -511,7 +510,7 @@ import org.apache.commons.io.FileUtils; // violation, should be in THIRD PARTY P import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; // violation, 'wrong order' import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; // violation, 'wrong order' - +
To configure the check so that it matches default NetBeans formatter configuration (tested on v8):
@@ -542,7 +541,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; import org.apache.commons.io.FileUtils; // violation, 'Extra separation' - +To set RegExps for THIRD_PARTY_PACKAGE and STANDARD_JAVA_PACKAGE groups use thirdPartyPackageRegExp and standardPackageRegExp options. @@ -574,7 +573,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; import org.apache.commons.io.FileUtils; - +
Also, this check can be configured to force empty line separator between import groups. For example. @@ -601,7 +600,7 @@ import javax.net.*; import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; import org.apache.commons.io.FileUtils; - +
It is possible to enforce ASCII sort order @@ -643,7 +642,7 @@ import static java.util.Collections.emptyList; import com.google.common.annotations.GwtCompatible; // violation, 'wrong order' import java.lang.String; - +
configure as follows:
diff --git a/src/site/xdoc/checks/imports/customimportorder.xml.template b/src/site/xdoc/checks/imports/customimportorder.xml.template index 84fbb00abb7..ee66da3f03d 100644 --- a/src/site/xdoc/checks/imports/customimportorder.xml.template +++ b/src/site/xdoc/checks/imports/customimportorder.xml.template @@ -141,7 +141,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +To configure the check so that it checks in the order (static imports,standard java packages,third party package): @@ -158,7 +158,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +
To configure the check such that only java packages are included in standard java packages
@@ -174,7 +174,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +To configure the check to include only "com" packages as third party group imports: @@ -191,7 +191,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +
To configure the check to force some packages in special import group:
@@ -207,7 +207,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +To configure the check such that empty line separator between two groups is enabled:
@@ -223,7 +223,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +To configure the check such that import groups are forced to be sorted alphabetically:
@@ -248,7 +248,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; then "org" and then all other importsNotes:
To configure the check so that it matches default Eclipse formatter configuration (tested on Mars release):
@@ -300,8 +300,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; "java", then "javax" and "java"Note: "separated" option is disabled because IDEA default has blank line between "java" and static imports, and no blank line between @@ -320,7 +319,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +
To configure the check so that it matches default NetBeans formatter configuration (tested on v8):
@@ -342,7 +341,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +To set RegExps for THIRD_PARTY_PACKAGE and STANDARD_JAVA_PACKAGE groups use thirdPartyPackageRegExp and standardPackageRegExp options. @@ -359,7 +358,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +
Also, this check can be configured to force empty line separator between import groups. For example. @@ -376,7 +375,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +
It is possible to enforce ASCII sort order @@ -402,7 +401,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; - +
configure as follows:
diff --git a/src/site/xdoc/checks/imports/illegalimport.xml b/src/site/xdoc/checks/imports/illegalimport.xml index 7b3c226bbeb..747804491c6 100644 --- a/src/site/xdoc/checks/imports/illegalimport.xml +++ b/src/site/xdoc/checks/imports/illegalimport.xml @@ -85,8 +85,7 @@ import java.util.Date; import sun.applet.*; // violation, 'Illegal import' public class Example1 {} - - +
To configure the check so that it rejects packages java.io.*
and java.sql.*
:
@@ -118,8 +117,7 @@ import java.util.Date;
import sun.applet.*;
public class Example2 {}
-
-
+
To configure the check so that it rejects classes java.util.Date
and
java.sql.Connection
:
@@ -152,8 +150,7 @@ import java.util.Date; // violation, 'Illegal import'
import sun.applet.*; // violation, 'Illegal import'
public class Example3 {}
-
-
+
To configure the check so that it rejects packages not satisfying to regular
expression java\.util
:
@@ -191,8 +188,7 @@ import java.util.Date; // violation, 'Illegal import'
import sun.applet.*;
public class Example4 {}
-
-
+
To configure the check so that it rejects class names not satisfying to regular
expression ^java\.util\.(List|Arrays)
and
diff --git a/src/site/xdoc/checks/imports/illegalimport.xml.template b/src/site/xdoc/checks/imports/illegalimport.xml.template
index fd35d613ea7..72049c2e4ff 100644
--- a/src/site/xdoc/checks/imports/illegalimport.xml.template
+++ b/src/site/xdoc/checks/imports/illegalimport.xml.template
@@ -50,8 +50,7 @@
-
-
+
To configure the check so that it rejects packages java.io.*
and java.sql.*
:
@@ -72,8 +71,7 @@
-
-
+
To configure the check so that it rejects classes java.util.Date
and
java.sql.Connection
:
@@ -94,8 +92,7 @@
-
-
+
To configure the check so that it rejects packages not satisfying to regular
expression java\.util
:
@@ -121,8 +118,7 @@
-
-
+
To configure the check so that it rejects class names not satisfying to regular
expression ^java\.util\.(List|Arrays)
and
diff --git a/src/site/xdoc/checks/imports/importorder.xml b/src/site/xdoc/checks/imports/importorder.xml
index 175dae566d6..3a858dc69f8 100644
--- a/src/site/xdoc/checks/imports/importorder.xml
+++ b/src/site/xdoc/checks/imports/importorder.xml
@@ -149,7 +149,7 @@ import com.neurologic.http.impl.ApacheHttpClient;
then "org" and then all other imports
Notes:
To configure the check so that it matches default Eclipse formatter configuration (tested on Mars release): @@ -252,7 +252,7 @@ import com.neurologic.http.impl.ApacheHttpClient; ImportOrder has a limitation by design to enforce an empty line between groups ("java", "javax"). There is no flexibility to enforce empty lines between some groups and no empty lines between other groups. -
+Note: "separated" option is disabled because IDEA default has blank line between "java" and static imports, and no blank line between "javax" and "java". @@ -287,7 +287,7 @@ import java.net.URL; // violation, extra separation in import group import java.security.KeyManagementException; import javax.swing.JComponent; // violation, wrong order, 'javax' should be above 'java' imports import com.neurologic.http.HttpClient; // violation, wrong order, 'com' imports should be at top - +
To configure the check so that it matches default NetBeans formatter configuration (tested on v8): @@ -337,7 +337,7 @@ import static javax.windowConstants.*; not, default value is false. It is applied to static imports grouped with top or bottom options. This option is helping in reconciling of this Check and other tools like Eclipse's Organize Imports feature. -
+To configure the Check allows static imports grouped to the top being sorted alphabetically: @@ -364,8 +364,7 @@ import static org.abego.treelayout.Configuration.AlignmentInLevel; // OK, alphab import java.util.Set; // violation, extra separation in import group import static java.lang.Math.abs; // violation, wrong order, all static imports comes at 'top' import org.abego.*; - - +
To configure the Check with groups of static imports:
@@ -410,7 +409,7 @@ import static HttpHeaders.Names.DATE => HttpHeaders.NamesAccording to this logic, HttpHeaders.Names should come after HttpHeaders. -
+
Example for useContainerOrderingForStatic=true
Example for useContainerOrderingForStatic=false
To configure the check to enforce static import group separation -
+
Example for separatedStaticGroups=true
To configure the Check with groups of static imports when staticGroups="" represents all imports as {@code everything else} group: @@ -513,7 +512,7 @@ import static java.io.File.listRoots; import static javax.swing.WindowConstants.*; import static java.io.File.createTempFile; import static com.puppycrawl.tools.checkstyle; - +
To configure the Check with groups of static imports when staticGroups="java, javax" represents three groups i.e java*, javax* diff --git a/src/site/xdoc/checks/imports/importorder.xml.template b/src/site/xdoc/checks/imports/importorder.xml.template index 06659fbb68c..00fa2948f02 100644 --- a/src/site/xdoc/checks/imports/importorder.xml.template +++ b/src/site/xdoc/checks/imports/importorder.xml.template @@ -69,7 +69,7 @@ then "org" and then all other imports
Notes:
To configure the check so that it matches default Eclipse formatter configuration (tested on Mars release): @@ -134,7 +134,7 @@ ImportOrder has a limitation by design to enforce an empty line between groups ("java", "javax"). There is no flexibility to enforce empty lines between some groups and no empty lines between other groups. -
+Note: "separated" option is disabled because IDEA default has blank line between "java" and static imports, and no blank line between "javax" and "java". @@ -151,7 +151,7 @@ - +
To configure the check so that it matches default NetBeans formatter configuration (tested on v8): @@ -194,7 +194,7 @@ not, default value is false. It is applied to static imports grouped with top or bottom options. This option is helping in reconciling of this Check and other tools like Eclipse's Organize Imports feature. -
+To configure the Check allows static imports grouped to the top being sorted alphabetically: @@ -212,8 +212,7 @@ - - +
To configure the Check with groups of static imports:
@@ -251,7 +250,7 @@ import static HttpHeaders.Names.DATE => HttpHeaders.NamesAccording to this logic, HttpHeaders.Names should come after HttpHeaders. -
+
Example for useContainerOrderingForStatic=true
Example for useContainerOrderingForStatic=false
To configure the check to enforce static import group separation -
+
Example for separatedStaticGroups=true
To configure the Check with groups of static imports when staticGroups="" represents all imports as {@code everything else} group: @@ -322,7 +321,7 @@ public class Example9 { } - +
To configure the Check with groups of static imports when staticGroups="java, javax" represents three groups i.e java*, javax* diff --git a/src/site/xdoc/checks/imports/unusedimports.xml b/src/site/xdoc/checks/imports/unusedimports.xml index 897e8f9129e..5a1d20eed06 100644 --- a/src/site/xdoc/checks/imports/unusedimports.xml +++ b/src/site/xdoc/checks/imports/unusedimports.xml @@ -122,7 +122,7 @@ class Example1{ int[] array = copyOf(arr , 1); Function <String, Integer> stringToInteger = Integer::parseInt; } - +
To configure the check so that it ignores the imports referenced in Javadoc comments:
diff --git a/src/site/xdoc/checks/imports/unusedimports.xml.template b/src/site/xdoc/checks/imports/unusedimports.xml.template index 36603809164..dd5b341d3da 100644 --- a/src/site/xdoc/checks/imports/unusedimports.xml.template +++ b/src/site/xdoc/checks/imports/unusedimports.xml.template @@ -84,7 +84,7 @@ - +To configure the check so that it ignores the imports referenced in Javadoc comments:
diff --git a/src/site/xdoc/checks/javadoc/atclauseorder.xml b/src/site/xdoc/checks/javadoc/atclauseorder.xml index 01272a196cf..fcebf0048e6 100644 --- a/src/site/xdoc/checks/javadoc/atclauseorder.xml +++ b/src/site/xdoc/checks/javadoc/atclauseorder.xml @@ -126,7 +126,7 @@ class Invalid1 implements Serializable {} * @author max // violation */ enum Test1 {} - +To configure the check such that it checks in the custom order:
@@ -185,7 +185,7 @@ class Invalid2 implements Serializable {} * @author max // violation */ enum Test2 {} - +To configure the check such that it targets only enums:
diff --git a/src/site/xdoc/checks/javadoc/atclauseorder.xml.template b/src/site/xdoc/checks/javadoc/atclauseorder.xml.template index ce42129a068..c856062f086 100644 --- a/src/site/xdoc/checks/javadoc/atclauseorder.xml.template +++ b/src/site/xdoc/checks/javadoc/atclauseorder.xml.template @@ -44,7 +44,7 @@ - +To configure the check such that it checks in the custom order:
@@ -60,7 +60,7 @@ - +To configure the check such that it targets only enums:
diff --git a/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml b/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml index 9df4f7d2471..48bbf558035 100644 --- a/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml +++ b/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml @@ -90,7 +90,7 @@ * A @custom tag (OK) * */ - +To configure the check to verify tags from JEP 8068562 only: @@ -103,7 +103,7 @@ </module> </module> </module> - +
To configure the check to verify all default tags and some custom tags in addition:
diff --git a/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml.template b/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml.template index 544beb558c9..31f331c7609 100644 --- a/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml.template +++ b/src/site/xdoc/checks/javadoc/javadocblocktaglocation.xml.template @@ -65,7 +65,7 @@ - +To configure the check to verify tags from JEP 8068562 only: @@ -74,7 +74,7 @@ - +
To configure the check to verify all default tags and some custom tags in addition:
diff --git a/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml b/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml index 7a76a5afcea..9a475624327 100644 --- a/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml +++ b/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml @@ -126,8 +126,7 @@ class Example1 { private int field3; } - - +To ensure that Javadoc content starts from the first line:
diff --git a/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml.template b/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml.template index 12a4cc25923..9959c3a9d33 100644 --- a/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml.template +++ b/src/site/xdoc/checks/javadoc/javadoccontentlocation.xml.template @@ -98,8 +98,7 @@ public void method(); - - +To ensure that Javadoc content starts from the first line:
diff --git a/src/site/xdoc/checks/javadoc/javadocleadingasteriskalign.xml b/src/site/xdoc/checks/javadoc/javadocleadingasteriskalign.xml index 32cc4a4b0c6..801d5dd1525 100644 --- a/src/site/xdoc/checks/javadoc/javadocleadingasteriskalign.xml +++ b/src/site/xdoc/checks/javadoc/javadocleadingasteriskalign.xml @@ -145,8 +145,7 @@ public class Example2 { THREE } } - - +
To configure the check with tabWidth
property:
To configure the check with tabWidth
property:
false
To configure the check for only public
modifier, ignoring any missing param tags is:
@@ -241,7 +241,7 @@ public class Example2 {
void m3(int p1) {}
}
-
+
To configure the check for methods which are in private
and
package
, but not any other modifier:
@@ -279,7 +279,7 @@ public class Example3 {
void m3(int p1) {}
}
-
+
To configure the check to ignore any missing return tags:
@@ -316,7 +316,7 @@ public class Example4 { void m3(int p1) {} // violation above, 'Expected @param tag for 'p1'' } - +
To configure the check to ignore Methods with annotation Deprecated
:
To configure the check only for tokens which are Constructor Definitions:
@@ -390,8 +390,7 @@ public class Example6 { void m3(int p1) {} } - - +
To configure the check to validate throws
tags, you can use following config.
To configure the check to allow inline return
tags,
you can use following config.
diff --git a/src/site/xdoc/checks/javadoc/javadocmethod.xml.template b/src/site/xdoc/checks/javadoc/javadocmethod.xml.template
index 32a3c991a7f..af4c2bf5fef 100644
--- a/src/site/xdoc/checks/javadoc/javadocmethod.xml.template
+++ b/src/site/xdoc/checks/javadoc/javadocmethod.xml.template
@@ -106,7 +106,7 @@ public int checkReturnTag(final int aTagIndex,
-
+
To configure the check for only public
modifier, ignoring any missing param tags is:
@@ -122,7 +122,7 @@ public int checkReturnTag(final int aTagIndex,
-
+
To configure the check for methods which are in private
and
package
, but not any other modifier:
@@ -137,7 +137,7 @@ public int checkReturnTag(final int aTagIndex,
-
+
To configure the check to ignore any missing return tags:
@@ -151,7 +151,7 @@ public int checkReturnTag(final int aTagIndex, - +
To configure the check to ignore Methods with annotation Deprecated
:
To configure the check only for tokens which are Constructor Definitions:
@@ -179,8 +179,7 @@ public int checkReturnTag(final int aTagIndex, - - +
To configure the check to validate throws
tags, you can use following config.
To configure the check to allow inline return
tags,
you can use following config.
diff --git a/src/site/xdoc/checks/javadoc/javadocparagraph.xml b/src/site/xdoc/checks/javadoc/javadocparagraph.xml
index 2a3b644a10e..6de6674f71a 100644
--- a/src/site/xdoc/checks/javadoc/javadocparagraph.xml
+++ b/src/site/xdoc/checks/javadoc/javadocparagraph.xml
@@ -140,7 +140,7 @@ public class Example1 {
*/
void foo3() {}
}
-
+
To not allow newlines and spaces immediately after the <p> tag:
diff --git a/src/site/xdoc/checks/javadoc/javadocparagraph.xml.template b/src/site/xdoc/checks/javadoc/javadocparagraph.xml.template index ce9e759e28c..06fefdba062 100644 --- a/src/site/xdoc/checks/javadoc/javadocparagraph.xml.template +++ b/src/site/xdoc/checks/javadoc/javadocparagraph.xml.template @@ -65,7 +65,7 @@ - +To not allow newlines and spaces immediately after the <p> tag:
diff --git a/src/site/xdoc/checks/javadoc/javadocstyle.xml b/src/site/xdoc/checks/javadoc/javadocstyle.xml index 7967138668f..43703c1f905 100644 --- a/src/site/xdoc/checks/javadoc/javadocstyle.xml +++ b/src/site/xdoc/checks/javadoc/javadocstyle.xml @@ -241,8 +241,7 @@ public class Example1 { // violation 3 lines above 'Incomplete HTML tag found' } } - - +
To configure the check for public
scope:
To configure the check for javadoc which is in private
, but not in
package
scope:
@@ -368,8 +366,7 @@ public class Example3 {
// violation 3 lines above 'Incomplete HTML tag'
}
}
-
-
+
To configure the check to turn off first sentence checking:
@@ -431,8 +428,7 @@ public class Example4 { // violation 3 lines above 'Incomplete HTML tag' } } - - +To configure the check to turn off validation of incomplete html tags:
@@ -494,8 +490,7 @@ public class Example5 { } } - - +To configure the check for only class definitions:
diff --git a/src/site/xdoc/checks/javadoc/javadocstyle.xml.template b/src/site/xdoc/checks/javadoc/javadocstyle.xml.template index 1d1261a0f9e..b80ccfef069 100644 --- a/src/site/xdoc/checks/javadoc/javadocstyle.xml.template +++ b/src/site/xdoc/checks/javadoc/javadocstyle.xml.template @@ -90,8 +90,7 @@ - - +
To configure the check for public
scope:
To configure the check for javadoc which is in private
, but not in
package
scope:
@@ -122,8 +120,7 @@
-
-
+
To configure the check to turn off first sentence checking:
@@ -138,8 +135,7 @@ - - +To configure the check to turn off validation of incomplete html tags:
@@ -154,8 +150,7 @@ - - +To configure the check for only class definitions:
diff --git a/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml b/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml index 165635b29db..d95714e82e9 100644 --- a/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml +++ b/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml @@ -85,7 +85,7 @@ class Example1 { // violation 3 lines above 'Line continuation have incorrect indentation level' } } - +To configure the check with two spaces indentation:
@@ -124,7 +124,7 @@ class Example2 { // OK, Indentation above 1 is fine as offset value is 2 } } - +To configure the check to show violations for Tight-HTML Rules:
diff --git a/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml.template b/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml.template index f9d3e1c3727..16ff0259ca1 100644 --- a/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml.template +++ b/src/site/xdoc/checks/javadoc/javadoctagcontinuationindentation.xml.template @@ -44,7 +44,7 @@ - +To configure the check with two spaces indentation:
@@ -60,7 +60,7 @@ - +To configure the check to show violations for Tight-HTML Rules:
diff --git a/src/site/xdoc/checks/javadoc/javadoctype.xml b/src/site/xdoc/checks/javadoc/javadoctype.xml index 4cb60a2990d..0959cec616a 100644 --- a/src/site/xdoc/checks/javadoc/javadoctype.xml +++ b/src/site/xdoc/checks/javadoc/javadoctype.xml @@ -177,8 +177,7 @@ public class Example1 { @Generated public class ClassG<T> {} } - - +
To configure the check for public
scope:
To configure the check for an @author
tag:
To configure the check for a CVS revision version tag:
@@ -327,8 +324,7 @@ public class Example4 { @Generated public class ClassG<T> {} } - - +
To configure the check for private
classes only:
To configure the check that allows missing @param
tags:
To configure the check that allows unknown tags:
@@ -478,8 +472,7 @@ public class Example7 { @Generated public class ClassG<T> {} } - - +
To configure a check that allows skipping validation at all
for classes annotated with @unknownTag
diff --git a/src/site/xdoc/checks/javadoc/javadoctype.xml.template b/src/site/xdoc/checks/javadoc/javadoctype.xml.template
index de4831e4b95..f08cd60e182 100644
--- a/src/site/xdoc/checks/javadoc/javadoctype.xml.template
+++ b/src/site/xdoc/checks/javadoc/javadoctype.xml.template
@@ -59,8 +59,7 @@
-
-
+
To configure the check for public
scope:
To configure the check for an @author
tag:
To configure the check for a CVS revision version tag:
@@ -104,8 +101,7 @@ - - +
To configure the check for private
classes only:
To configure the check that allows missing @param
tags:
To configure the check that allows unknown tags:
@@ -149,8 +143,7 @@ - - +
To configure a check that allows skipping validation at all
for classes annotated with @unknownTag
diff --git a/src/site/xdoc/checks/javadoc/javadocvariable.xml b/src/site/xdoc/checks/javadoc/javadocvariable.xml
index ed02a653928..1fb5af366e9 100644
--- a/src/site/xdoc/checks/javadoc/javadocvariable.xml
+++ b/src/site/xdoc/checks/javadoc/javadocvariable.xml
@@ -86,8 +86,7 @@ public class Example1 {
/*package*/ int e; // violation, 'Missing a Javadoc comment'
}
-
-
+
To configure the check public
access modifier:
@@ -118,8 +117,7 @@ public class Example2 {
public int d; // violation, 'Missing a Javadoc comment'
/*package*/ int e;
}
-
-
+
To configure the check for fields which are in private
or
package
access modifier:
@@ -150,7 +148,7 @@ public class Example3 {
public int d;
/*package*/ int e; // violation, 'Missing a Javadoc comment'
}
-
+
To ignore absence of Javadoc comments for fields with names log
or
logger
:
diff --git a/src/site/xdoc/checks/javadoc/javadocvariable.xml.template b/src/site/xdoc/checks/javadoc/javadocvariable.xml.template
index 07e07336794..89109a3a306 100644
--- a/src/site/xdoc/checks/javadoc/javadocvariable.xml.template
+++ b/src/site/xdoc/checks/javadoc/javadocvariable.xml.template
@@ -41,8 +41,7 @@
-
-
+
To configure the check public
access modifier:
@@ -61,8 +60,7 @@
-
-
+
To configure the check for fields which are in private
or
package
access modifier:
@@ -81,7 +79,7 @@
-
+
To ignore absence of Javadoc comments for fields with names log
or
logger
:
diff --git a/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml b/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml
index b883a139f93..5bf518e487e 100644
--- a/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml
+++ b/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml
@@ -164,8 +164,7 @@ public class Example1 {
protected void testMethod4() {}
void testMethod5() {}
}
-
-
+
To configure the check for private
scope:
@@ -198,8 +197,7 @@ public class Example2 {
protected void testMethod4() {} // violation, 'Missing a Javadoc comment'
void testMethod5() {} // violation, 'Missing a Javadoc comment'
}
-
-
+
To configure the check for methods which are in private
,
but not in protected
scope:
@@ -233,8 +231,7 @@ public class Example3 {
protected void testMethod4() {}
void testMethod5() {} // violation, 'Missing a Javadoc comment'
}
-
-
+
To configure the check for ignoring methods named foo(),foo1(),foo2()
, etc.:
To configure the check for ignoring missing javadoc for accessor methods:
@@ -299,8 +295,7 @@ public class Example5 { protected void testMethod4() {} void testMethod5() {} } - - +To configure the check with annotations that allow missed documentation:
diff --git a/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml.template b/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml.template index 9583b47acb2..eb5484799f0 100644 --- a/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml.template +++ b/src/site/xdoc/checks/javadoc/missingjavadocmethod.xml.template @@ -74,8 +74,7 @@ public boolean isSomething() - - +
To configure the check for private
scope:
@@ -90,8 +89,7 @@ public boolean isSomething()
-
-
+
To configure the check for methods which are in private
,
but not in protected
scope:
@@ -106,8 +104,7 @@ public boolean isSomething()
-
-
+
To configure the check for ignoring methods named foo(),foo1(),foo2()
, etc.:
To configure the check for ignoring missing javadoc for accessor methods:
@@ -136,8 +132,7 @@ public boolean isSomething() - - +To configure the check with annotations that allow missed documentation:
diff --git a/src/site/xdoc/checks/javadoc/missingjavadoctype.xml b/src/site/xdoc/checks/javadoc/missingjavadoctype.xml index 2bc39202390..fdd3913ca4b 100644 --- a/src/site/xdoc/checks/javadoc/missingjavadoctype.xml +++ b/src/site/xdoc/checks/javadoc/missingjavadoctype.xml @@ -107,8 +107,7 @@ class Example1 { protected class testClass3 {} class testClass4 {} } - - +
To configure the check for private
scope:
To configure the check for private
classes only:
Example3:
class Example3 {
@@ -159,8 +156,7 @@ class Example3 {
class testClass4 {}
}
-
To configure a check that allows missing comments for classes annotated with
@SpringBootApplication
and @Configuration
:
@@ -181,8 +177,7 @@ public class Application {}
@Configuration // no violations about missing comment on class
class DatabaseConfiguration {}
-
-
+
To configure a check that allows missing comments for classes annotated with
@Annotation
and @MyClass.Annotation
:
diff --git a/src/site/xdoc/checks/javadoc/missingjavadoctype.xml.template b/src/site/xdoc/checks/javadoc/missingjavadoctype.xml.template
index 033ff9099fb..b40d13b00b6 100644
--- a/src/site/xdoc/checks/javadoc/missingjavadoctype.xml.template
+++ b/src/site/xdoc/checks/javadoc/missingjavadoctype.xml.template
@@ -43,8 +43,7 @@
-
-
+
To configure the check for private
scope:
To configure the check for private
classes only:
Example3:
To configure a check that allows missing comments for classes annotated with
@SpringBootApplication
and @Configuration
:
@@ -91,8 +87,7 @@
-
-
+
To configure a check that allows missing comments for classes annotated with
@Annotation
and @MyClass.Annotation
:
diff --git a/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml b/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml
index 2386fbd2182..95e18b4be32 100644
--- a/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml
+++ b/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml
@@ -101,7 +101,7 @@ class Example1 {
// violation 6 lines above 'At-clause should have a non-empty description'
}
}
-
+
To configure the check to validate @param
,
@throws
tags:
diff --git a/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml.template b/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml.template
index 8aca8477099..7402e023c82 100644
--- a/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml.template
+++ b/src/site/xdoc/checks/javadoc/nonemptyatclausedescription.xml.template
@@ -40,7 +40,7 @@
-
+
To configure the check to validate @param
,
@throws
tags:
diff --git a/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml b/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml
index 70d7f37217f..258d11b368a 100644
--- a/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml
+++ b/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml
@@ -101,7 +101,7 @@ public class Example1 {
return 42;
}
}
-
+
To configure the check with a list of ignored block tags:
@@ -150,7 +150,7 @@ public class Example2 { return 42; } } - +To configure the check to not ignore inline tags:
@@ -199,7 +199,7 @@ public class Example3 { return 42; } } - +To configure the check to report violations for Tight-HTML Rules:
diff --git a/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml.template b/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml.template index a5f2092e39b..225241fc8d0 100644 --- a/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml.template +++ b/src/site/xdoc/checks/javadoc/singlelinejavadoc.xml.template @@ -41,7 +41,7 @@ - +To configure the check with a list of ignored block tags:
@@ -57,7 +57,7 @@ - +To configure the check to not ignore inline tags:
@@ -73,7 +73,7 @@ - +To configure the check to report violations for Tight-HTML Rules:
diff --git a/src/site/xdoc/checks/javadoc/summaryjavadoc.xml b/src/site/xdoc/checks/javadoc/summaryjavadoc.xml index 3491a31f649..1c0a09fc099 100644 --- a/src/site/xdoc/checks/javadoc/summaryjavadoc.xml +++ b/src/site/xdoc/checks/javadoc/summaryjavadoc.xml @@ -122,7 +122,7 @@ class Example1 { public void m8() {} } - +To ensure that summary does not contain phrase like "This method returns", use following config: @@ -185,7 +185,7 @@ class Example2 { public void m8() {} } - +
To specify period symbol at the end of first javadoc sentence:
diff --git a/src/site/xdoc/checks/javadoc/summaryjavadoc.xml.template b/src/site/xdoc/checks/javadoc/summaryjavadoc.xml.template index 2e98e50fa76..f266b62024c 100644 --- a/src/site/xdoc/checks/javadoc/summaryjavadoc.xml.template +++ b/src/site/xdoc/checks/javadoc/summaryjavadoc.xml.template @@ -50,7 +50,7 @@ - +To ensure that summary does not contain phrase like "This method returns", use following config: @@ -65,7 +65,7 @@ - +
To specify period symbol at the end of first javadoc sentence:
diff --git a/src/site/xdoc/checks/javadoc/writetag.xml b/src/site/xdoc/checks/javadoc/writetag.xml index 14e152f9ed6..ac54d008170 100644 --- a/src/site/xdoc/checks/javadoc/writetag.xml +++ b/src/site/xdoc/checks/javadoc/writetag.xml @@ -123,7 +123,7 @@ public class Example1 { public void testMethod2() {} } - +
To configure Check to demand some special tag (for example @since
)
to be present on classes javadoc.
@@ -156,7 +156,7 @@ public class Example2 {
public void testMethod2() {}
}
-
+
To configure Check to demand some special tag (for example @since
)
to be present on method javadocs also in addition to default tokens.
@@ -193,7 +193,7 @@ public class Example3 {
public void testMethod2() {}
}
-
+
To configure Check to demand @since
tag
to be present with digital value on method javadocs also in addition to default tokens.
@@ -233,7 +233,7 @@ public class Example4 {
public void testMethod2() {}
// violation 1 lines above 'Type Javadoc comment is missing @since tag.'
}
-
+
To configure Check to demand @since
tag
and in the same time print violation with specific severity on each presence of such tag.
diff --git a/src/site/xdoc/checks/javadoc/writetag.xml.template b/src/site/xdoc/checks/javadoc/writetag.xml.template
index 57b9c448fa6..4e0a145f1d9 100644
--- a/src/site/xdoc/checks/javadoc/writetag.xml.template
+++ b/src/site/xdoc/checks/javadoc/writetag.xml.template
@@ -42,7 +42,7 @@
-
+
To configure Check to demand some special tag (for example @since
)
to be present on classes javadoc.
@@ -59,7 +59,7 @@
-
+
To configure Check to demand some special tag (for example @since
)
to be present on method javadocs also in addition to default tokens.
@@ -76,7 +76,7 @@
-
+
To configure Check to demand @since
tag
to be present with digital value on method javadocs also in addition to default tokens.
@@ -94,7 +94,7 @@
-
+
To configure Check to demand @since
tag
and in the same time print violation with specific severity on each presence of such tag.
diff --git a/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml b/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml
index dbdbdbcabc6..ba3cc3d8f9f 100644
--- a/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml
+++ b/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml
@@ -117,7 +117,7 @@ public class Example1
// 1(^) + 1(||) + 1(^) + 1(||) + 1(&) + 1(|) = 6
}
}
-
+
To configure the check with 5 allowed operation in boolean expression: @@ -150,7 +150,7 @@ public class Example2 // 1(^) + 1(||) + 1(^) + 1(||) + 1(&) + 1(|) = 6 } } - +
To configure the check to ignore &
and
|
:
diff --git a/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml.template b/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml.template
index 2b47a2cb7fe..5c5727521d0 100644
--- a/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml.template
+++ b/src/site/xdoc/checks/metrics/booleanexpressioncomplexity.xml.template
@@ -57,7 +57,7 @@
-
+
To configure the check with 5 allowed operation in boolean expression: @@ -72,7 +72,7 @@ - +
To configure the check to ignore &
and
|
:
diff --git a/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml b/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml
index d643c457e29..092cdff5edc 100644
--- a/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml
+++ b/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml
@@ -138,7 +138,7 @@ public class Example1 {
private Instant instant = Instant.now(); // Counted 1
private LocalTime localTime = LocalTime.now(); // Counted 2
}
-
+
The check results in a violation in the following: @@ -158,7 +158,7 @@ public class Example2 { Example6 example6 = new Example6(); Example7 example7 = new Example7(); // Counted 8 } - +
To configure the check with a threshold of 2: @@ -186,7 +186,7 @@ public class Example3 { Instant instant = Instant.now(); // Counted 1 LocalTime localTime = LocalTime.now(); // Counted 2 } - +
The check results in a violation in the following: @@ -200,7 +200,7 @@ public class Example4 { BigInteger bigInteger = new BigInteger("0"); BigDecimal bigDecimal = new BigDecimal("0"); // Counted 3 } - +
To configure the check with three excluded classes HashMap
,
@@ -236,7 +236,7 @@ public class Example5 {
Example6 example6 = new Example6();
Example7 example7 = new Example7(); // Counted 7
}
-
+
The check results in a violation in the following: @@ -256,7 +256,7 @@ public class Example6 { Example7 example7 = new Example7(); Example8 example8 = new Example8(); // Counted 8 } - +
To configure the check to exclude classes with a regular expression @@ -294,7 +294,7 @@ public class Example7 { // Ignored using module excludeClassesRegexps property BufferedReader bufferedReader = new BufferedReader(new PipedReader()); } - +
The check results in a violation in the following: @@ -314,7 +314,7 @@ public class Example8 { StringWriter stringWriter = new StringWriter(); File file = new File("path"); // Counted 8 } - +
To configure the check with an excluded package java.io
:
@@ -328,7 +328,7 @@ public class Example8 {
</module>
</module>
</module>
-
+
Example: @@ -354,7 +354,7 @@ public class Example9 { PipedReader pipedReader = new PipedReader(); BufferedReader bufferedReader = new BufferedReader(pipedReader); } - +
The check results in a violation in the following: diff --git a/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml.template b/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml.template index 96b1793d249..2db057cc81a 100644 --- a/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml.template +++ b/src/site/xdoc/checks/metrics/classdataabstractioncoupling.xml.template @@ -98,7 +98,7 @@ - +
The check results in a violation in the following: @@ -107,7 +107,7 @@ - +
To configure the check with a threshold of 2: @@ -128,7 +128,7 @@ - +
The check results in a violation in the following: @@ -137,7 +137,7 @@ - +
To configure the check with three excluded classes HashMap
,
@@ -159,7 +159,7 @@
-
+
The check results in a violation in the following: @@ -168,7 +168,7 @@ - +
To configure the check to exclude classes with a regular expression @@ -190,7 +190,7 @@ - +
The check results in a violation in the following: @@ -199,7 +199,7 @@ - +
To configure the check with an excluded package java.io
:
@@ -209,7 +209,7 @@
-
+
Example: @@ -221,7 +221,7 @@ - +
The check results in a violation in the following: diff --git a/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml b/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml index 749eddfea15..55e6a665ffc 100644 --- a/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml +++ b/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml @@ -110,7 +110,7 @@ class Example1{ } class Place1 {} class Time1 {} - +
To configure the check with a threshold of 2:
@@ -145,7 +145,7 @@ class Example2{ // violation 'Class Fan-Out Complexity is 5 (max allowed is 2)' } class Place2 {} class Time2 {} - +
To configure the check with three excluded classes HashMap
,
@@ -183,7 +183,7 @@ class Example3{ // violation 'Class Fan-Out Complexity is 7 (max allowed is 3)'
}
class Place3 {}
class Time3 {}
-
+
To configure the check to exclude classes with a regular expression
.*Reader$
:
@@ -220,7 +220,7 @@ class Example4{ // violation 'Class Fan-Out Complexity is 4 (max allowed is 3)'
}
class Place4 {}
class Time4 {}
-
+
To configure the check with an excluded package java.io
:
@@ -283,7 +283,7 @@ class Time5 {}
Also note, that excludedPackages
will not exclude classes, imported via
wildcard (e.g. import java.math.*
). Instead of wildcard import you should
use direct import (e.g. import java.math.BigDecimal
).
-
Also note, that checkstyle will not exclude classes within the same file
even if it was listed in the excludedPackages
parameter. For example,
diff --git a/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml.template b/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml.template
index df5b101e46f..9a6d026389c 100644
--- a/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml.template
+++ b/src/site/xdoc/checks/metrics/classfanoutcomplexity.xml.template
@@ -63,7 +63,7 @@
-
+
To configure the check with a threshold of 2:
@@ -82,7 +82,7 @@ - +
To configure the check with three excluded classes HashMap
,
@@ -103,7 +103,7 @@
-
+
To configure the check to exclude classes with a regular expression
.*Reader$
:
@@ -123,7 +123,7 @@
-
+
To configure the check with an excluded package java.io
:
@@ -169,7 +169,7 @@
Also note, that excludedPackages
will not exclude classes, imported via
wildcard (e.g. import java.math.*
). Instead of wildcard import you should
use direct import (e.g. import java.math.BigDecimal
).
-
Also note, that checkstyle will not exclude classes within the same file
even if it was listed in the excludedPackages
parameter. For example,
diff --git a/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml b/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml
index 72d109233f5..dc95a4a8fc9 100644
--- a/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml
+++ b/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml
@@ -204,7 +204,7 @@ class Example1 {
}
private void fun1() {}
}
-
+
To configure the check with a threshold of 4 and check only for while and do-while loops:
@@ -278,7 +278,7 @@ class Example2 { } private void fun1() {} } - +To configure the check to consider switch-case block as one decision point.
diff --git a/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml.template b/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml.template index 83b5aa2b917..0b2c24136f6 100644 --- a/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml.template +++ b/src/site/xdoc/checks/metrics/cyclomaticcomplexity.xml.template @@ -75,7 +75,7 @@ - +To configure the check with a threshold of 4 and check only for while and do-while loops:
@@ -91,7 +91,7 @@ - +To configure the check to consider switch-case block as one decision point.
diff --git a/src/site/xdoc/checks/metrics/javancss.xml b/src/site/xdoc/checks/metrics/javancss.xml index be9f2c050b0..e6e76033f8c 100644 --- a/src/site/xdoc/checks/metrics/javancss.xml +++ b/src/site/xdoc/checks/metrics/javancss.xml @@ -115,7 +115,7 @@ class Example1 { System.out.println("m-2:Line 3"); } } - +To configure the check with 4 allowed non commented lines for a method:
@@ -150,7 +150,7 @@ class Example2 { System.out.println("m-2:Line 3"); } } - +To configure the check to set limit of non commented lines in class to 10:
@@ -183,7 +183,7 @@ class Example3 { System.out.println("m-2:Line 3"); } } - +To configure the check to set limit of non commented lines in file to 10:
diff --git a/src/site/xdoc/checks/metrics/javancss.xml.template b/src/site/xdoc/checks/metrics/javancss.xml.template index b78523b53dc..a76951b6950 100644 --- a/src/site/xdoc/checks/metrics/javancss.xml.template +++ b/src/site/xdoc/checks/metrics/javancss.xml.template @@ -65,7 +65,7 @@ - +To configure the check with 4 allowed non commented lines for a method:
@@ -81,7 +81,7 @@ - +To configure the check to set limit of non commented lines in class to 10:
@@ -95,7 +95,7 @@ - +To configure the check to set limit of non commented lines in file to 10:
diff --git a/src/site/xdoc/checks/metrics/npathcomplexity.xml b/src/site/xdoc/checks/metrics/npathcomplexity.xml index 56121ce23e7..862bb79432d 100644 --- a/src/site/xdoc/checks/metrics/npathcomplexity.xml +++ b/src/site/xdoc/checks/metrics/npathcomplexity.xml @@ -189,7 +189,7 @@ public abstract class Example1 { public abstract String buzz(); public abstract void print(String str); } - +To configure the check with a threshold of 100:
diff --git a/src/site/xdoc/checks/metrics/npathcomplexity.xml.template b/src/site/xdoc/checks/metrics/npathcomplexity.xml.template index fc1a8bff47c..9511c994974 100644 --- a/src/site/xdoc/checks/metrics/npathcomplexity.xml.template +++ b/src/site/xdoc/checks/metrics/npathcomplexity.xml.template @@ -129,7 +129,7 @@ - +To configure the check with a threshold of 100:
diff --git a/src/site/xdoc/checks/misc/arraytypestyle.xml b/src/site/xdoc/checks/misc/arraytypestyle.xml index 3654c2df218..7e16c2f548a 100644 --- a/src/site/xdoc/checks/misc/arraytypestyle.xml +++ b/src/site/xdoc/checks/misc/arraytypestyle.xml @@ -74,7 +74,7 @@ public class Example1 { return null; } } - +To configure the check to enforce C style:
diff --git a/src/site/xdoc/checks/misc/arraytypestyle.xml.template b/src/site/xdoc/checks/misc/arraytypestyle.xml.template index fc40d0294f2..bab7cc85169 100644 --- a/src/site/xdoc/checks/misc/arraytypestyle.xml.template +++ b/src/site/xdoc/checks/misc/arraytypestyle.xml.template @@ -51,7 +51,7 @@ - +To configure the check to enforce C style:
diff --git a/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml b/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml index c5f86708592..9d6804ef351 100644 --- a/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml +++ b/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml @@ -96,7 +96,7 @@ public class Example1 { return '\ufeff' + content; } } - +An example of how to configure the check to allow using escapes for non-printable, control characters: @@ -131,7 +131,7 @@ public class Example2 { return '\ufeff' + content; } } - +
An example of how to configure the check to allow using escapes if trail comment is present: @@ -166,7 +166,7 @@ public class Example3 { return '\ufeff' + content; } } - +
An example of how to configure the check to allow if all characters in literal are escaped. @@ -199,7 +199,7 @@ public class Example4 { return '\ufeff' + content; } } - +
An example of how to configure the check to allow using escapes for non-printable whitespace characters: diff --git a/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml.template b/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml.template index 667419b79de..b3b1cbaefb9 100644 --- a/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml.template +++ b/src/site/xdoc/checks/misc/avoidescapedunicodecharacters.xml.template @@ -47,7 +47,7 @@ - +
An example of how to configure the check to allow using escapes for non-printable, control characters: @@ -64,7 +64,7 @@ - +
An example of how to configure the check to allow using escapes if trail comment is present: @@ -81,7 +81,7 @@ - +
An example of how to configure the check to allow if all characters in literal are escaped. @@ -96,7 +96,7 @@ - +
An example of how to configure the check to allow using escapes for non-printable whitespace characters: diff --git a/src/site/xdoc/checks/misc/commentsindentation.xml b/src/site/xdoc/checks/misc/commentsindentation.xml index 427206d153e..213303d6874 100644 --- a/src/site/xdoc/checks/misc/commentsindentation.xml +++ b/src/site/xdoc/checks/misc/commentsindentation.xml @@ -92,7 +92,7 @@ public class Example1 { } // violation 2 lines above 'Comment has incorrect indentation level 8' } - +
To configure the Check to validate only single-line comments:
@@ -134,7 +134,7 @@ public class Example2 { } // violation 2 lines above 'Comment has incorrect indentation level 8' } - +Please take a look at the following examples to understand how the check works:
Example #3: Comment is used as a single-line border to separate groups of methods. @@ -151,7 +151,7 @@ public class Example3 { // violation 2 lines above 'Comment has incorrect indentation level 4' public void foo2() {} } - +
Example #4: Single line block comment is placed within an empty code block. Note, if comment is placed at the end of the empty code block, we have Checkstyle's @@ -174,7 +174,7 @@ public class Example4 { // It is not okay } } - +
Example #5: 'fallthrough' comments and Also similar comments placed within an empty case block.Note, if comment is placed at the end of the empty case block, we have Checkstyle limitations to @@ -206,7 +206,7 @@ public class Example5 { } } } - +
Example #6: Comment is placed within a distributed statement.
public class Example6 {
@@ -223,7 +223,7 @@ public class Example6 {
}
}
-
Example #7: Single line block comment has previous and next statement.
@@ -248,7 +248,7 @@ public class Example7 { // violation 4 lines above 'Comment has incorrect indentation level 7' } } - +Example #8: Comment within the block tries to describe the next code block.
diff --git a/src/site/xdoc/checks/misc/commentsindentation.xml.template b/src/site/xdoc/checks/misc/commentsindentation.xml.template index 594a420a838..7dcc49e5136 100644 --- a/src/site/xdoc/checks/misc/commentsindentation.xml.template +++ b/src/site/xdoc/checks/misc/commentsindentation.xml.template @@ -45,7 +45,7 @@ - +To configure the Check to validate only single-line comments:
@@ -62,7 +62,7 @@ - +Please take a look at the following examples to understand how the check works:
Example #3: Comment is used as a single-line border to separate groups of methods. @@ -71,7 +71,7 @@ - +
Example #4: Single line block comment is placed within an empty code block. Note, if comment is placed at the end of the empty code block, we have Checkstyle's @@ -84,7 +84,7 @@ - +
Example #5: 'fallthrough' comments and Also similar comments placed within an empty case block.Note, if comment is placed at the end of the empty case block, we have Checkstyle limitations to @@ -97,13 +97,13 @@ - +
Example #6: Comment is placed within a distributed statement.
Example #7: Single line block comment has previous and next statement.
@@ -111,7 +111,7 @@ - +Example #8: Comment within the block tries to describe the next code block.
diff --git a/src/site/xdoc/checks/misc/descendanttoken.xml b/src/site/xdoc/checks/misc/descendanttoken.xml index 9acc44b7104..2ed60537992 100644 --- a/src/site/xdoc/checks/misc/descendanttoken.xml +++ b/src/site/xdoc/checks/misc/descendanttoken.xml @@ -187,7 +187,7 @@ class Example1 { } } } - +To configure the check to produce a violation on a switch with too many cases: @@ -271,7 +271,7 @@ class Example2 { } } } - +
To configure the check to produce a violation on a switch that is @@ -356,7 +356,7 @@ class Example3 { } } } - +
To configure the check to produce a violation on a @@ -401,7 +401,7 @@ class Example4 { } } } - +
To configure the check to produce a violation on an initializer in @@ -447,7 +447,7 @@ class Example5 { } } } - +
To configure the check to produce a violation on a return statement @@ -504,7 +504,7 @@ class Example6 { } } } - +
To configure the check to produce a violation on a try statement @@ -561,7 +561,7 @@ class Example7 { } } } - +
To configure the check to produce a violation on a method with @@ -613,7 +613,7 @@ class Example8 { } } } - +
To configure the check to produce a violation on a method @@ -664,7 +664,7 @@ class Example9 { } } } - +
To configure the check to produce a violation on a method @@ -694,7 +694,7 @@ class Example10 { // ... } } - +
To configure the check to produce a violation on a method @@ -727,7 +727,7 @@ class Example11 { int z = x + y; } } - +
To configure the check to produce a violation on an empty statement: @@ -758,7 +758,7 @@ class Example12 { ; // violation, 'Empty statement is not allowed' } } - +
To configure the check to produce a violation on a class or interface @@ -800,7 +800,7 @@ interface Test2 { int FIELD_1 = 1; int FIELD_2 = 2; } - +
To configure the check to produce a violation on @@ -843,7 +843,7 @@ class Example14 { } } } - +
To configure the check to produce a violation on a String
@@ -876,7 +876,7 @@ class Example15 {
}
}
}
-
+
To configure the check to produce a violation on an assert statement diff --git a/src/site/xdoc/checks/misc/descendanttoken.xml.template b/src/site/xdoc/checks/misc/descendanttoken.xml.template index 4a302a73089..19d64ea655b 100644 --- a/src/site/xdoc/checks/misc/descendanttoken.xml.template +++ b/src/site/xdoc/checks/misc/descendanttoken.xml.template @@ -49,7 +49,7 @@ - +
To configure the check to produce a violation on a switch with too many cases: @@ -66,7 +66,7 @@ - +
To configure the check to produce a violation on a switch that is @@ -84,7 +84,7 @@ - +
To configure the check to produce a violation on a @@ -102,7 +102,7 @@ - +
To configure the check to produce a violation on an initializer in @@ -121,7 +121,7 @@ - +
To configure the check to produce a violation on a return statement @@ -139,7 +139,7 @@ - +
To configure the check to produce a violation on a try statement @@ -157,7 +157,7 @@ - +
To configure the check to produce a violation on a method with @@ -175,7 +175,7 @@ - +
To configure the check to produce a violation on a method @@ -193,7 +193,7 @@ - +
To configure the check to produce a violation on a method @@ -211,7 +211,7 @@ - +
To configure the check to produce a violation on a method @@ -229,7 +229,7 @@ - +
To configure the check to produce a violation on an empty statement: @@ -246,7 +246,7 @@ - +
To configure the check to produce a violation on a class or interface @@ -264,7 +264,7 @@ - +
To configure the check to produce a violation on @@ -282,7 +282,7 @@ - +
To configure the check to produce a violation on a String
@@ -300,7 +300,7 @@
-
+
To configure the check to produce a violation on an assert statement diff --git a/src/site/xdoc/checks/misc/finalparameters.xml b/src/site/xdoc/checks/misc/finalparameters.xml index d23589b4848..12d331ec12d 100644 --- a/src/site/xdoc/checks/misc/finalparameters.xml +++ b/src/site/xdoc/checks/misc/finalparameters.xml @@ -100,7 +100,7 @@ public class Example1 { public void methodTwo(int x) { } // violation, 'x should be final' public static void main(String[] args) { } // violation, 'args should be final' } - +
To configure the check to enforce final parameters only for constructors: @@ -126,7 +126,7 @@ public class Example2 { public void methodTwo(int x) { } public static void main(String[] args) { } } - +
To configure the check to allow ignoring
@@ -153,7 +153,7 @@ public class Example3 {
public void methodTwo(int x) { }
public static void main(String[] args) { } // violation, 'args should be final'
}
-
+
To configure the check to enforce final parameters for catch and
for-each blocks while ignoring unnamed parameters:
diff --git a/src/site/xdoc/checks/misc/finalparameters.xml.template b/src/site/xdoc/checks/misc/finalparameters.xml.template
index c6d9d91774c..347190c7bc8 100644
--- a/src/site/xdoc/checks/misc/finalparameters.xml.template
+++ b/src/site/xdoc/checks/misc/finalparameters.xml.template
@@ -50,7 +50,7 @@
-
+
To configure the check to enforce final parameters only for
constructors:
@@ -67,7 +67,7 @@
-
+ Configuration: Configuration: Configuration:
To configure to check variables, enforcing no abbreviations
except for variables that are both static and final.
- Configuration:
To configure to check variables, enforcing no abbreviations
and ignoring static (but non-final) variables only.
- Configuration: Configuration:
To configure to include static variables and
methods tagged with Configuration: Configuration: Configuration: Configuration: Configuration: Configuration:
To configure the check so that it check name
but ignore
To configure the check to ignore name
validation when class declared as 'abstract'
@@ -126,7 +126,7 @@ class Example3 {
abstract class GeneratorFifth {}
class GeneratorSixth {}
}
-
To configure the check
with
To configure the check so that it check name
but ignore
To configure the check to ignore name
validation when class declared as 'abstract'
@@ -73,7 +73,7 @@
-
+
To configure the check
with
An example of how to configure the check for names that begin with
a lower case letter, followed by any letters or digits is:
diff --git a/src/site/xdoc/checks/naming/catchparametername.xml.template b/src/site/xdoc/checks/naming/catchparametername.xml.template
index 6ddbd3b5b5b..0e9a5d17749 100644
--- a/src/site/xdoc/checks/naming/catchparametername.xml.template
+++ b/src/site/xdoc/checks/naming/catchparametername.xml.template
@@ -53,7 +53,7 @@
-
+
An example of how to configure the check for names that begin with
a lower case letter, followed by any letters or digits is:
diff --git a/src/site/xdoc/checks/naming/classtypeparametername.xml b/src/site/xdoc/checks/naming/classtypeparametername.xml
index 1a057fca490..bf0cfb15eb7 100644
--- a/src/site/xdoc/checks/naming/classtypeparametername.xml
+++ b/src/site/xdoc/checks/naming/classtypeparametername.xml
@@ -53,7 +53,7 @@ class Example1 {
class MyClass4<LISTENER> {} // violation 'Name 'LISTENER' must match pattern'
class MyClass5<RequestT> {} // violation 'Name 'RequestT' must match pattern'
}
-
+
To configure the check for names that are uppercase word:
To configure the check for names that are camel case word with T as suffix
(Google Style):
diff --git a/src/site/xdoc/checks/naming/classtypeparametername.xml.template b/src/site/xdoc/checks/naming/classtypeparametername.xml.template
index 8ba50b352c1..ebc2fa205d8 100644
--- a/src/site/xdoc/checks/naming/classtypeparametername.xml.template
+++ b/src/site/xdoc/checks/naming/classtypeparametername.xml.template
@@ -35,7 +35,7 @@
-
+
To configure the check for names that are uppercase word:
To configure the check for names that are camel case word with T as suffix
(Google Style):
diff --git a/src/site/xdoc/checks/naming/constantname.xml b/src/site/xdoc/checks/naming/constantname.xml
index 68a69fdb2c2..a18376f9381 100644
--- a/src/site/xdoc/checks/naming/constantname.xml
+++ b/src/site/xdoc/checks/naming/constantname.xml
@@ -90,7 +90,7 @@ class Example1 {
final static int MYSELF = 100;
protected final static int myselfConstant = 1; // violation 'must match pattern'
}
-
+
The following configuration apart from names allowed by default allows
The following configuration skip validation on
public constant field and protected constant field.
diff --git a/src/site/xdoc/checks/naming/constantname.xml.template b/src/site/xdoc/checks/naming/constantname.xml.template
index e66b79df1f7..32a6ad708fc 100644
--- a/src/site/xdoc/checks/naming/constantname.xml.template
+++ b/src/site/xdoc/checks/naming/constantname.xml.template
@@ -40,7 +40,7 @@
-
+
The following configuration apart from names allowed by default allows
The following configuration skip validation on
public constant field and protected constant field.
diff --git a/src/site/xdoc/checks/naming/illegalidentifiername.xml b/src/site/xdoc/checks/naming/illegalidentifiername.xml
index 760985269bc..68d38ffe35c 100644
--- a/src/site/xdoc/checks/naming/illegalidentifiername.xml
+++ b/src/site/xdoc/checks/naming/illegalidentifiername.xml
@@ -140,7 +140,7 @@ public class Example1 {
Object transitiveObject = "transitiveObject";
}
-
+
To configure the check to match a maximum of three test strings:
To configure the check to match a minimum of two test strings:
To configure the check to restrict an empty file:
To configure the check to forbid 'xml' files in folders:
To configure the check to forbid 'md' files except 'README.md file' in folders,
with custom message:
@@ -157,7 +157,7 @@
.../TestExample2.xml
.../TestExample3.md // violation, 'No *.md files other than README.md'
.../TestExample4.xml
-
+
To configure the check to only allow property and xml files to be located
in the resource folder:
@@ -179,7 +179,7 @@
.../TestExample2.xml
.../TestExample3.md // violation, 'Only property and xml files to be located in the resource folder'
.../TestExample4.xml
-
+
To configure the check to only allow only camelcase
To configure the check to forbid 'xml' files in folders:
To configure the check to forbid 'md' files except 'README.md file' in folders,
with custom message:
@@ -101,7 +101,7 @@
-
+
To configure the check to only allow property and xml files to be located
in the resource folder:
@@ -116,7 +116,7 @@
-
+
To configure the check to only allow only camelcase
<module name="Checker">
@@ -225,7 +225,7 @@ class Example2 extends SuperClass { // OK, camel case
(including ones with the static modifier) and enforce
no abbreviations (essentially camel case) except for
words like 'XML' and 'URL'.
-
+
<module name="Checker">
@@ -259,7 +259,7 @@ class Example3 {
To configure to check variables, excluding fields with
the static modifier, and allow abbreviations up to 2
consecutive capital letters ignoring the longer word 'CSV'.
-
+
<module name="Checker">
@@ -290,7 +290,7 @@ class Example4 { // OK, ignore checking the class name
<module name="Checker">
@@ -318,7 +318,7 @@ class Example5 {
<module name="Checker">
@@ -348,7 +348,7 @@ class Example6 {
To configure to check variables, enforce
no abbreviations (essentially camel case) except for
words like 'ALLOWED'.
-
+
<module name="Checker">
diff --git a/src/site/xdoc/checks/naming/abbreviationaswordinname.xml.template b/src/site/xdoc/checks/naming/abbreviationaswordinname.xml.template
index 6883d433e2b..bf0c98942af 100644
--- a/src/site/xdoc/checks/naming/abbreviationaswordinname.xml.template
+++ b/src/site/xdoc/checks/naming/abbreviationaswordinname.xml.template
@@ -65,7 +65,7 @@
@Override
annotation.
-
abstract
modifier:
@@ -102,7 +102,7 @@ class Example2 {
// violation above 'must match pattern'
class GeneratorSixth {}
}
-
format
:
diff --git a/src/site/xdoc/checks/naming/abstractclassname.xml.template b/src/site/xdoc/checks/naming/abstractclassname.xml.template
index 8842befa04c..6e1468c5630 100644
--- a/src/site/xdoc/checks/naming/abstractclassname.xml.template
+++ b/src/site/xdoc/checks/naming/abstractclassname.xml.template
@@ -43,7 +43,7 @@
-
+
abstract
modifier:
@@ -58,7 +58,7 @@
-
+
format
:
diff --git a/src/site/xdoc/checks/naming/catchparametername.xml b/src/site/xdoc/checks/naming/catchparametername.xml
index 066e0391ba4..b82b8b78392 100644
--- a/src/site/xdoc/checks/naming/catchparametername.xml
+++ b/src/site/xdoc/checks/naming/catchparametername.xml
@@ -84,7 +84,7 @@ public class Example1 {
}
}
}
-
+
log
or logger
:
@@ -119,7 +119,7 @@ class Example2 {
final static int MYSELF = 100;
protected final static int myselfConstant = 1; // violation 'must match pattern'
}
-
+
log
or logger
:
@@ -56,7 +56,7 @@
-
+
To configure the check to find occurrences of 'System.exit(' with some slack of allowing only one occurrence per file: @@ -118,7 +118,7 @@ public class Example2 { void doSomething(){} } - +
Example with violation:
public class Example3 {
@@ -133,7 +133,7 @@ public class Example3 {
void doSomething(){}
}
-
An example of how to configure the check to make sure a copyright statement is included in the file: @@ -154,7 +154,7 @@ public class Example3 { * This file is copyrighted under CC. */ public class Example4 {} - +
An example of how to configure the check to make sure a copyright statement is included in the file: @@ -179,7 +179,7 @@ package com.puppycrawl.tools.checkstyle.checks.regexp.regexpsingleline; * MyClass as a configuration example. */ public class Example5 {} - +
An example of how to configure the check to make sure sql files contains the term 'license'. @@ -205,7 +205,7 @@ public class Example5 {} AP 2.0 License. // Ok, Check ignores the case of the term. */ CREATE DATABASE MyDB; - +
Example with violation:
/* // violation, file doesn't contain the term.
diff --git a/src/site/xdoc/checks/regexp/regexpsingleline.xml.template b/src/site/xdoc/checks/regexp/regexpsingleline.xml.template
index 215637aad54..1eb2778d679 100644
--- a/src/site/xdoc/checks/regexp/regexpsingleline.xml.template
+++ b/src/site/xdoc/checks/regexp/regexpsingleline.xml.template
@@ -42,7 +42,7 @@
This configuration does not match to anything,
so we do not provide any code example for it
as no violation will ever be reported.
-
+
To configure the check to find occurrences of 'System.exit('
with some slack of allowing only one occurrence per file:
@@ -58,13 +58,13 @@
-
+
Example with violation:
-
+
An example of how to configure the check to make sure a copyright
statement is included in the file:
@@ -79,7 +79,7 @@
-
+
An example of how to configure the check to make sure a copyright
statement is included in the file:
@@ -94,7 +94,7 @@
-
+
An example of how to configure the check to make sure sql files contains the term
'license'.
@@ -109,7 +109,7 @@
-
+
Example with violation:
To configure the check for calls to System.out.println
, except in comments:
To configure the check to find case-insensitive occurrences of "debug": @@ -215,7 +215,7 @@ class Example3 { logger.info("fifth"); } } - +
To configure the check to find occurrences of "\.read(.*)|\.write(.*)" @@ -263,7 +263,7 @@ class Example4 { logger.info("fifth"); } } - +
To configure the check to find occurrences of "\.log(.*)". We want to allow a maximum of 2 occurrences. @@ -310,7 +310,7 @@ class Example5 { logger.info("fifth"); // violation, 'Line matches the illegal pattern' } } - +
To configure the check to find all occurrences of "public". We want to ignore comments, @@ -361,7 +361,7 @@ class Example6 { logger.info("fifth"); } } - +
To configure the check to find all occurrences of "private". We want to ignore comments, diff --git a/src/site/xdoc/checks/regexp/regexpsinglelinejava.xml.template b/src/site/xdoc/checks/regexp/regexpsinglelinejava.xml.template index 49f0900a58a..be1c7b5e2b0 100644 --- a/src/site/xdoc/checks/regexp/regexpsinglelinejava.xml.template +++ b/src/site/xdoc/checks/regexp/regexpsinglelinejava.xml.template @@ -43,7 +43,7 @@ - +
To configure the check for calls to System.out.println
, except in comments:
To configure the check to find case-insensitive occurrences of "debug": @@ -72,7 +72,7 @@ - +
To configure the check to find occurrences of "\.read(.*)|\.write(.*)" @@ -88,7 +88,7 @@ - +
To configure the check to find occurrences of "\.log(.*)". We want to allow a maximum of 2 occurrences. @@ -103,7 +103,7 @@ - +
To configure the check to find all occurrences of "public". We want to ignore comments, @@ -120,7 +120,7 @@ - +
To configure the check to find all occurrences of "private". We want to ignore comments, diff --git a/src/site/xdoc/checks/sizes/anoninnerlength.xml b/src/site/xdoc/checks/sizes/anoninnerlength.xml index 9c97a144957..3456cb70aec 100644 --- a/src/site/xdoc/checks/sizes/anoninnerlength.xml +++ b/src/site/xdoc/checks/sizes/anoninnerlength.xml @@ -78,7 +78,7 @@ class Example1 { longAnonClass.run(); } } - +
To configure the check to accept anonymous classes with up to 7 lines:
diff --git a/src/site/xdoc/checks/sizes/anoninnerlength.xml.template b/src/site/xdoc/checks/sizes/anoninnerlength.xml.template index c62bee117b6..368a8fa33b1 100644 --- a/src/site/xdoc/checks/sizes/anoninnerlength.xml.template +++ b/src/site/xdoc/checks/sizes/anoninnerlength.xml.template @@ -45,7 +45,7 @@ - +To configure the check to accept anonymous classes with up to 7 lines:
diff --git a/src/site/xdoc/checks/sizes/executablestatementcount.xml b/src/site/xdoc/checks/sizes/executablestatementcount.xml index e60f6ff1949..95fcfb99c3f 100644 --- a/src/site/xdoc/checks/sizes/executablestatementcount.xml +++ b/src/site/xdoc/checks/sizes/executablestatementcount.xml @@ -94,7 +94,7 @@ class Example1 { int sum = a + b; } } - +To configure the check with a threshold of 2 for constructor: @@ -124,7 +124,7 @@ class Example2 { int sum = a + b; } } - +
To configure the check with a threshold of 2 for method definitions: diff --git a/src/site/xdoc/checks/sizes/executablestatementcount.xml.template b/src/site/xdoc/checks/sizes/executablestatementcount.xml.template index 94a407e526c..23d549a75f0 100644 --- a/src/site/xdoc/checks/sizes/executablestatementcount.xml.template +++ b/src/site/xdoc/checks/sizes/executablestatementcount.xml.template @@ -35,7 +35,7 @@ - +
To configure the check with a threshold of 2 for constructor: @@ -50,7 +50,7 @@ - +
To configure the check with a threshold of 2 for method definitions: diff --git a/src/site/xdoc/checks/sizes/filelength.xml b/src/site/xdoc/checks/sizes/filelength.xml index 5e431757101..9bf1cc2683e 100644 --- a/src/site/xdoc/checks/sizes/filelength.xml +++ b/src/site/xdoc/checks/sizes/filelength.xml @@ -65,7 +65,7 @@ public class Example1 { String test = "Some content"; } } - +
To configure the check to accept files with up to 5 lines:
@@ -84,7 +84,7 @@ public class Example2 { String test = "Some content"; // there is violation } } - +To configure the check to accept files with up to 5 lines and with txt extension only:
diff --git a/src/site/xdoc/checks/sizes/filelength.xml.template b/src/site/xdoc/checks/sizes/filelength.xml.template index 42d400e57a7..22243653e43 100644 --- a/src/site/xdoc/checks/sizes/filelength.xml.template +++ b/src/site/xdoc/checks/sizes/filelength.xml.template @@ -43,7 +43,7 @@ - +To configure the check to accept files with up to 5 lines:
@@ -57,7 +57,7 @@ - +To configure the check to accept files with up to 5 lines and with txt extension only:
diff --git a/src/site/xdoc/checks/sizes/lambdabodylength.xml b/src/site/xdoc/checks/sizes/lambdabodylength.xml index efe8bedacc7..aee9918b9ea 100644 --- a/src/site/xdoc/checks/sizes/lambdabodylength.xml +++ b/src/site/xdoc/checks/sizes/lambdabodylength.xml @@ -92,7 +92,7 @@ class Example1 { .concat("10") .concat("11"); // line 11 } - +To configure the check to accept lambda bodies with max 5 lines:
diff --git a/src/site/xdoc/checks/sizes/lambdabodylength.xml.template b/src/site/xdoc/checks/sizes/lambdabodylength.xml.template index 397d0e62f08..0d188814465 100644 --- a/src/site/xdoc/checks/sizes/lambdabodylength.xml.template +++ b/src/site/xdoc/checks/sizes/lambdabodylength.xml.template @@ -46,7 +46,7 @@ - +To configure the check to accept lambda bodies with max 5 lines:
diff --git a/src/site/xdoc/checks/sizes/linelength.xml b/src/site/xdoc/checks/sizes/linelength.xml index 7f4878351b3..f92357f402e 100644 --- a/src/site/xdoc/checks/sizes/linelength.xml +++ b/src/site/xdoc/checks/sizes/linelength.xml @@ -86,7 +86,7 @@ class Example1 { System.out.println("This line is long and exceeds the default limit of 80 characters."); } } - +To configure the check to accept lines up to 120 characters long: @@ -119,7 +119,7 @@ class Example2 { System.out.println("This line is long and exceeds the default limit of 80 characters."); } } - +
To configure the check to ignore lines that begin with " * "
code,
@@ -153,7 +153,7 @@ class Example3 {
System.out.println("This line is long and exceeds the default limit of 80 characters.");
}
}
-
+
To configure the check to only validate xml and property files and ignore other @@ -187,7 +187,7 @@ class Example4 { System.out.println("This line is long and exceeds the default limit of 80 characters."); } } - +
To configure check to validate import
statements:
diff --git a/src/site/xdoc/checks/sizes/linelength.xml.template b/src/site/xdoc/checks/sizes/linelength.xml.template
index a2b5aa3c1d2..f3116847222 100644
--- a/src/site/xdoc/checks/sizes/linelength.xml.template
+++ b/src/site/xdoc/checks/sizes/linelength.xml.template
@@ -46,7 +46,7 @@
-
+
To configure the check to accept lines up to 120 characters long: @@ -63,7 +63,7 @@ - +
To configure the check to ignore lines that begin with " * "
code,
@@ -81,7 +81,7 @@
-
+
To configure the check to only validate xml and property files and ignore other @@ -99,7 +99,7 @@ - +
To configure check to validate import
statements:
diff --git a/src/site/xdoc/checks/sizes/methodcount.xml b/src/site/xdoc/checks/sizes/methodcount.xml
index 1a57468d323..2b56c71d966 100644
--- a/src/site/xdoc/checks/sizes/methodcount.xml
+++ b/src/site/xdoc/checks/sizes/methodcount.xml
@@ -170,7 +170,7 @@ class Example1 {
public void innerMethod2() {} // NOT counted towards Example1
}
}
-
+
To configure the check to allow no more than 5 methods per type declaration:
@@ -205,7 +205,7 @@ class Example2 { // violation, 'Total number of methods is 6 (max allowed is 5)' public void innerMethod2() {} // NOT counted towards Example2 } } - +To configure the check to allow no more than 2 public methods per type declaration, and 6 methods in total: diff --git a/src/site/xdoc/checks/sizes/methodcount.xml.template b/src/site/xdoc/checks/sizes/methodcount.xml.template index 79ffe4d9fde..57db3117a9a 100644 --- a/src/site/xdoc/checks/sizes/methodcount.xml.template +++ b/src/site/xdoc/checks/sizes/methodcount.xml.template @@ -76,7 +76,7 @@ public class ExampleClass { - +
To configure the check to allow no more than 5 methods per type declaration:
@@ -90,7 +90,7 @@ public class ExampleClass { - +To configure the check to allow no more than 2 public methods per type declaration, and 6 methods in total: diff --git a/src/site/xdoc/checks/sizes/methodlength.xml b/src/site/xdoc/checks/sizes/methodlength.xml index 5a7caad7bdb..8dc207af728 100644 --- a/src/site/xdoc/checks/sizes/methodlength.xml +++ b/src/site/xdoc/checks/sizes/methodlength.xml @@ -131,7 +131,7 @@ public class Example1 { } } } - +
To configure the check so that it accepts methods with at most 4 lines: @@ -192,7 +192,7 @@ public class Example2 { } } } - +
To configure the check so that it accepts methods with at most 4 lines, not counting empty lines and comments: diff --git a/src/site/xdoc/checks/sizes/methodlength.xml.template b/src/site/xdoc/checks/sizes/methodlength.xml.template index 3ed2c6779b9..cba953485d2 100644 --- a/src/site/xdoc/checks/sizes/methodlength.xml.template +++ b/src/site/xdoc/checks/sizes/methodlength.xml.template @@ -44,7 +44,7 @@ - +
To configure the check so that it accepts methods with at most 4 lines: @@ -59,7 +59,7 @@ - +
To configure the check so that it accepts methods with at most 4 lines, not counting empty lines and comments: diff --git a/src/site/xdoc/checks/sizes/outertypenumber.xml b/src/site/xdoc/checks/sizes/outertypenumber.xml index 4e1b6c0fd04..63b9c661f9d 100644 --- a/src/site/xdoc/checks/sizes/outertypenumber.xml +++ b/src/site/xdoc/checks/sizes/outertypenumber.xml @@ -65,7 +65,7 @@ class Example { enum outer { } - +
To configure the check to accept 2 outer types per file: diff --git a/src/site/xdoc/checks/sizes/outertypenumber.xml.template b/src/site/xdoc/checks/sizes/outertypenumber.xml.template index d5bc555036b..5b680f559c7 100644 --- a/src/site/xdoc/checks/sizes/outertypenumber.xml.template +++ b/src/site/xdoc/checks/sizes/outertypenumber.xml.template @@ -43,7 +43,7 @@ - +
To configure the check to accept 2 outer types per file: diff --git a/src/site/xdoc/checks/sizes/parameternumber.xml b/src/site/xdoc/checks/sizes/parameternumber.xml index a8d85008f4e..1774e1bad7e 100644 --- a/src/site/xdoc/checks/sizes/parameternumber.xml +++ b/src/site/xdoc/checks/sizes/parameternumber.xml @@ -106,7 +106,7 @@ class ExternalService1 { String e, String f, String g, String h) {} } - +
To configure the check to allow 10 parameters for a method:
@@ -151,7 +151,7 @@ class ExternalService2 {
To configure the check to ignore number of parameters for methods with
@Override
or @java.lang.Override annotation
.
-
Rationale: developer may need to override method with many parameters from 3-rd party library. @@ -193,7 +193,7 @@ class ExternalService3 { String e, String f, String g, String h) {} } - +
To configure the check to ignore methods and constructors annotated with
JsonCreator
annotation:
diff --git a/src/site/xdoc/checks/sizes/parameternumber.xml.template b/src/site/xdoc/checks/sizes/parameternumber.xml.template
index 1ebd1f321e8..803221ca3e5 100644
--- a/src/site/xdoc/checks/sizes/parameternumber.xml.template
+++ b/src/site/xdoc/checks/sizes/parameternumber.xml.template
@@ -37,7 +37,7 @@
-
+
To configure the check to allow 10 parameters for a method:
@@ -55,7 +55,7 @@
To configure the check to ignore number of parameters for methods with
@Override
or @java.lang.Override annotation
.
-
Rationale: developer may need to override method with many parameters from 3-rd party library. @@ -71,7 +71,7 @@ - +
To configure the check to ignore methods and constructors annotated with
JsonCreator
annotation:
diff --git a/src/site/xdoc/checks/sizes/recordcomponentnumber.xml b/src/site/xdoc/checks/sizes/recordcomponentnumber.xml
index b24b51e81bc..c9e983ffa0a 100644
--- a/src/site/xdoc/checks/sizes/recordcomponentnumber.xml
+++ b/src/site/xdoc/checks/sizes/recordcomponentnumber.xml
@@ -73,7 +73,7 @@ class Example1{
private record MyRecord4(int x, int y,
String str, double d) {}
}
-
+
To configure the check to allow 5 record components at all access modifier levels for record definitions: @@ -103,7 +103,7 @@ class Example2{ private record MyRecord4(int x, int y, String str, double d) {} } - +
To configure the check to allow 10 record components for a public record definition, but 3 for private record definitions: diff --git a/src/site/xdoc/checks/sizes/recordcomponentnumber.xml.template b/src/site/xdoc/checks/sizes/recordcomponentnumber.xml.template index 5d8c5c17842..e501202412b 100644 --- a/src/site/xdoc/checks/sizes/recordcomponentnumber.xml.template +++ b/src/site/xdoc/checks/sizes/recordcomponentnumber.xml.template @@ -43,7 +43,7 @@ - +
To configure the check to allow 5 record components at all access modifier levels for record definitions: @@ -60,7 +60,7 @@ - +
To configure the check to allow 10 record components for a public record definition, but 3 for private record definitions: diff --git a/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml b/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml index d532b27cf38..50051c5f8d9 100644 --- a/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml +++ b/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml @@ -69,7 +69,7 @@ class Example1 { ; i < 2; i++ ); } } - +
To configure the check to require white space at an empty for diff --git a/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml.template b/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml.template index c0e274f53bd..348c2cebdfb 100644 --- a/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml.template +++ b/src/site/xdoc/checks/whitespace/emptyforinitializerpad.xml.template @@ -47,7 +47,7 @@ for ( - +
To configure the check to require white space at an empty for diff --git a/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml b/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml index 7e76c93da25..fadcf9ddd28 100644 --- a/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml +++ b/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml @@ -70,7 +70,7 @@ class Example1 { ); } } - +
To configure the check to require white space at an empty for iterator: diff --git a/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml.template b/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml.template index c7f59fd9a42..b2eabc3e7ca 100644 --- a/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml.template +++ b/src/site/xdoc/checks/whitespace/emptyforiteratorpad.xml.template @@ -47,7 +47,7 @@ for (Iterator foo = very.long.line.iterator(); - +
To configure the check to require white space at an empty for iterator: diff --git a/src/site/xdoc/checks/whitespace/emptylineseparator.xml b/src/site/xdoc/checks/whitespace/emptylineseparator.xml index d38ea566c6a..a7631af62ca 100644 --- a/src/site/xdoc/checks/whitespace/emptylineseparator.xml +++ b/src/site/xdoc/checks/whitespace/emptylineseparator.xml @@ -165,7 +165,7 @@ class Example1 { int var5 = 5; } } - +
To check empty line before
@@ -207,7 +207,7 @@ class Example2 {
int var5 = 5;
}
}
-
+
To allow no empty line between fields:
@@ -250,7 +250,7 @@ class Example3 {
int var5 = 5;
}
}
-
+
To disallow multiple empty lines between class members:
To disallow multiple empty lines inside constructor,
initialization block and method:
diff --git a/src/site/xdoc/checks/whitespace/emptylineseparator.xml.template b/src/site/xdoc/checks/whitespace/emptylineseparator.xml.template
index 5f04955fdda..476d8feb3b6 100644
--- a/src/site/xdoc/checks/whitespace/emptylineseparator.xml.template
+++ b/src/site/xdoc/checks/whitespace/emptylineseparator.xml.template
@@ -52,7 +52,7 @@
-
+
To check empty line before
@@ -70,7 +70,7 @@
-
+
To allow no empty line between fields:
@@ -87,7 +87,7 @@
-
+
To disallow multiple empty lines between class members:
To disallow multiple empty lines inside constructor,
initialization block and method:
diff --git a/src/site/xdoc/checks/whitespace/filetabcharacter.xml b/src/site/xdoc/checks/whitespace/filetabcharacter.xml
index 2723b77530f..2b4a4b3e16b 100644
--- a/src/site/xdoc/checks/whitespace/filetabcharacter.xml
+++ b/src/site/xdoc/checks/whitespace/filetabcharacter.xml
@@ -84,7 +84,7 @@ class Example1 {
a = arg; // OK, indented using spaces
}
}
-
+ To configure the check to report each instance in each file:
To configure the check to report instances on only certain file types:
Example - Test.xml: Example - Test.html: To configure the check to report each instance in each file:
To configure the check to report instances on only certain file types:
Example - Test.xml: Example - Test.html:
Examples with incorrect spacing:
Examples with incorrect spacing:
To configure the check to require a space after the identifier of a
diff --git a/src/site/xdoc/checks/whitespace/methodparampad.xml.template b/src/site/xdoc/checks/whitespace/methodparampad.xml.template
index d111eba997f..e7a3716394c 100644
--- a/src/site/xdoc/checks/whitespace/methodparampad.xml.template
+++ b/src/site/xdoc/checks/whitespace/methodparampad.xml.template
@@ -45,7 +45,7 @@
-
+
To configure the check to require a space after the identifier of a
diff --git a/src/site/xdoc/checks/whitespace/nolinewrap.xml b/src/site/xdoc/checks/whitespace/nolinewrap.xml
index 2137f7bfda0..f6972ff1eb4 100644
--- a/src/site/xdoc/checks/whitespace/nolinewrap.xml
+++ b/src/site/xdoc/checks/whitespace/nolinewrap.xml
@@ -91,7 +91,7 @@ import com.puppycrawl.tools. // violation 'should not be line-wrapped'
import static java.math. // violation 'should not be line-wrapped'
BigInteger.ZERO;
-
+
Examples:
Example:
To configure the check to force no line-wrapping only
in import statements:
@@ -141,7 +141,7 @@ import java.lang. // violation 'should not be line-wrapped'
import static java.math. // OK, STATIC_IMPORT is not part of the tokens
BigInteger.ZERO;
-
+
To configure the check to force no line-wrapping only
in class, method and constructor definitions:
diff --git a/src/site/xdoc/checks/whitespace/nolinewrap.xml.template b/src/site/xdoc/checks/whitespace/nolinewrap.xml.template
index ec4b8e012f1..5f860e64d3f 100644
--- a/src/site/xdoc/checks/whitespace/nolinewrap.xml.template
+++ b/src/site/xdoc/checks/whitespace/nolinewrap.xml.template
@@ -42,7 +42,7 @@
-
+
Examples:
Example:
To configure the check to force no line-wrapping only
in import statements:
@@ -73,7 +73,7 @@
-
+
To configure the check to force no line-wrapping only
in class, method and constructor definitions:
diff --git a/src/site/xdoc/checks/whitespace/nowhitespaceafter.xml b/src/site/xdoc/checks/whitespace/nowhitespaceafter.xml
index 493075be0b7..0075e40df30 100644
--- a/src/site/xdoc/checks/whitespace/nowhitespaceafter.xml
+++ b/src/site/xdoc/checks/whitespace/nowhitespaceafter.xml
@@ -165,7 +165,7 @@ class Example1 {
a = ~a;
}
}
-
+
To configure the check to forbid linebreaks after a DOT token:
To configure the check to forbid linebreaks after a DOT token:
To configure the check to allow linebreaks before default tokens:
To Configure the check to restrict the use of whitespace before METHOD_REF and DOT tokens:
To configure the check to allow linebreak before METHOD_REF and DOT tokens:
To configure the check to allow linebreaks before default tokens:
To Configure the check to restrict the use of whitespace before METHOD_REF and DOT tokens:
To configure the check to allow linebreak before METHOD_REF and DOT tokens:
To configure the check for assignment operators at the end of a line:
To configure the check for assignment operators at the end of a line:
To configure the check to require spaces for the parentheses of
constructor, method, and super constructor calls:
diff --git a/src/site/xdoc/checks/whitespace/parenpad.xml.template b/src/site/xdoc/checks/whitespace/parenpad.xml.template
index a1c068da17a..3d11e2fb373 100644
--- a/src/site/xdoc/checks/whitespace/parenpad.xml.template
+++ b/src/site/xdoc/checks/whitespace/parenpad.xml.template
@@ -52,7 +52,7 @@
-
+
To configure the check to require spaces for the parentheses of
constructor, method, and super constructor calls:
diff --git a/src/site/xdoc/checks/whitespace/separatorwrap.xml b/src/site/xdoc/checks/whitespace/separatorwrap.xml
index 09678a316aa..6e43ca2ce19 100644
--- a/src/site/xdoc/checks/whitespace/separatorwrap.xml
+++ b/src/site/xdoc/checks/whitespace/separatorwrap.xml
@@ -102,7 +102,7 @@ class Example1 {
}
}
}
-
+
To configure the check to ignore the colon:
Goal: Run Checkstyle on both a folder and an individual file in one execution,
+demonstrating that folders are processed recursively and that no trailing slash is needed. Directory Structure: Content of config.xml: Content of Other.java (in src2): Content of Test.java (in src1): Output:
+
For example, the following configuration fragment specifies base
directory
+
To configure a
+
To configure a
+
To configure a
+
To configure a
<module name="Checker">
@@ -102,7 +102,7 @@ class Example2 {
a = arg; // OK, indented using spaces
}
}
-
<?xml version="1.0" encoding="UTF-8" ?>
@@ -130,7 +130,7 @@ class Example3 {
<FirstName>John</FirstName> // violation 'File contains tab characters'
<LastName>Doe</LastName> <!-- OK, only first occurrence in file reported -->
</UserAccount>
-
<head>
diff --git a/src/site/xdoc/checks/whitespace/filetabcharacter.xml.template b/src/site/xdoc/checks/whitespace/filetabcharacter.xml.template
index 52821908571..1d860bbbf03 100644
--- a/src/site/xdoc/checks/whitespace/filetabcharacter.xml.template
+++ b/src/site/xdoc/checks/whitespace/filetabcharacter.xml.template
@@ -61,7 +61,7 @@
-
+
package com.puppycrawl.tools.checkstyle.checks.whitespace.nolinewrap;
@@ -114,7 +114,7 @@ import java.lang. // violation 'should not be line-wrapped'
Boolean;
import static java.math.BigInteger.ONE;
-
+
1. Using Configuration File (-c, --configurationFile)
@@ -1712,11 +1719,11 @@ Usage: checkstyle [-dEghjJtTV] [-b=<xpath>] [-c=<configurationFile>]
[-f=<format>] [-o=<outputPath>] [-p=<propertiesFile>]
[-s=<suppressionLineColumnNumber>] [-w=<tabWidth>]
[-e=<exclude>]...[-x=<excludeRegex>]...
- <files>...
+ <files or folders>...
Checkstyle verifies that the specified source code files adhere to the specified rules.
By default, violations are reported to standard out in plain format.
Checkstyle requires a configuration XML file that configures the checks to apply.
- <files>... One or more source files to verify
+ <files or folders>... One or more source files to verify
-b, --branch-matching-xpath=<xpath>
Shows Abstract Syntax Tree(AST) branches that match given XPath query.
-c=<configurationFile> Specifies the location of the file that defines the
@@ -1838,6 +1845,100 @@ Starting audit...
Audit done.
+
+
+19. Handling Folder and File Inputs (folder and file)
+
+
+java -jar checkstyle-${projectVersion}-all.jar -c config.xml src2 src1\Test.java
+
+
+
+src2
+└── Other.java
+src1
+└── Test.java
+
+
+
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+ "https://checkstyle.org/dtds/configuration_1_3.dtd">
+<module name="Checker">
+ <module name="TreeWalker">
+ <module name="FallThrough"/>
+ <module name="UnnecessaryParenthesesCheck"/>
+ </module>
+</module>
+
+
+/**
+ * Javadoc summary.
+ *
+ * Some description.
+ */
+public class Other {
+ public void testMethod() {
+ int a = (5); // violation expected: unnecessary parentheses
+ }
+}
+
+
+/**
+ * Javadoc summary.
+ *
+ * Some description.
+ */
+public class Test {
+ /**
+ * Some summary on method.
+ */
+ public void foo() {
+ int i = 0;
+ while (i >= 0) {
+ switch (i) {
+ case 1:
+ case 2:
+ i++;
+ case 3: // violation expected: fall through from previous branch
+ i++;
+ }
+ }
+ }
+}
+
+
+Starting audit...
+[ERROR] C:\Users\checkstyle\src2\Other.java:6:18: Unnecessary parentheses
+around literal '5'. [UnnecessaryParentheses]
+[ERROR] C:\Users\checkstyle\src1\Test.java:12:17: Fall through from
+previous branch of the switch statement. [FallThrough]
+Audit done.
+Checkstyle ends with 2 errors.
+
src/checkstyle
, cache file target/cachefile
and German
locale for all modules:
@@ -430,7 +430,7 @@
</module>
- Checker
so that it
handles files with the ISO-8859-5
charset:
Checker
so that it
handles files with the java, xml, properties
extensions:
Checker
so that it doesn't stop execution on an
Exception
and instead prints it as a violation:
Checker
so that it
handles files with any extension:
+
Common part checkstyle-common.xml
:
<module name="FileLength">
@@ -52,7 +52,7 @@
</module>
+
Main config checkstyle.xml
:
<?xml version="1.0"?>
@@ -74,7 +74,7 @@
</module>
+
Test config checkstyle-test.xml
:
<?xml version="1.0"?>
@@ -96,7 +96,7 @@
</module>
+
Target file for validation Test.java
:
class Test {
@@ -104,7 +104,7 @@ class Test {
}
+
Example of execution for checkstyle.xml
. Violation from Check of
common.xml
is expected, validation of field name is done by main code rules:
@@ -117,7 +117,7 @@ Audit done.
Checkstyle ends with 2 errors.
+
Example of execution for checkstyle-test.xml
. Violation from Check of
common.xml
is expected, validation of field name is done by test code rules:
diff --git a/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml b/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml
index 1d4ea6cfaf7..a8b1b2922d9 100644
--- a/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml
+++ b/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml
@@ -78,7 +78,7 @@
.../test/generated_StubBankRemote.java // violation, must start with an uppercase
.../test/MockPaymentRemote.java
.../module-info.java // violation, name must start with an uppercase
-
To configure the filter to exclude all 'module-info.java' files:
@@ -108,7 +108,7 @@ .../test/generated_StubBankRemote.java // violation, must start with an uppercase .../test/MockPaymentRemote.java .../module-info.java // OK, the file is not audited - +To configure the filter to run only on required files for example that ends with "Remote" or end with "Client" in names or named as "Remote.java" or "Client.java" @@ -141,7 +141,7 @@ .../test/generated_StubBankRemote.java // violation, must start with an uppercase .../test/MockPaymentRemote.java .../module-info.java // OK, the file is not audited - +
To configure the filter to exclude all 'test' folder files and all 'module-info.java' files: diff --git a/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml.template b/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml.template index e71c571f07e..e1d103c5881 100644 --- a/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml.template +++ b/src/site/xdoc/filefilters/beforeexecutionexclusionfilefilter.xml.template @@ -52,7 +52,7 @@ - +
To configure the filter to exclude all 'module-info.java' files:
@@ -66,7 +66,7 @@ - +To configure the filter to run only on required files for example that ends with "Remote" or end with "Client" in names or named as "Remote.java" or "Client.java" @@ -82,7 +82,7 @@ - +
To configure the filter to exclude all 'test' folder files and all 'module-info.java' files: diff --git a/src/site/xdoc/filters/suppressioncommentfilter.xml b/src/site/xdoc/filters/suppressioncommentfilter.xml index 477328d7ad7..145578b4833 100644 --- a/src/site/xdoc/filters/suppressioncommentfilter.xml +++ b/src/site/xdoc/filters/suppressioncommentfilter.xml @@ -131,14 +131,14 @@ class Example1 int VAR1; // violation, Name 'VAR1' must match pattern '^[a-z][a-zA-Z0-9]*$' //CHECKSTYLE:OFF - int VAR2; // suppressed violation + int VAR2; // filtered violation 'must match pattern' //CHECKSTYLE:ON public static final int var3 = 1; // violation above, 'must match pattern' //CHECKSTYLE:OFF - public static final int var4 = 1; // suppressed violation + public static final int var4 = 1; // filtered violation 'must match pattern' //CHECKSTYLE:ON public void method1() @@ -149,13 +149,15 @@ class Example1 //CHECKSTYLE:OFF try {} - catch(Exception ex) {} // suppressed violation - catch(Error err) {} // suppressed violation + catch(Exception ex) {} + // filtered violation above 'Catching 'Exception' is not allowed' + catch(Error err) {} + // filtered violation above 'Catching 'Error' is not allowed' //CHECKSTYLE:ON } } - +
To configure a filter so that // stop constant
check
and // resume constant check
marks
@@ -189,7 +191,7 @@ class Example2
// violation above, Name 'must match pattern'
//stop constant check
- public static final int var4 = 1; // suppressed violation
+ public static final int var4 = 1; // filtered violation 'must match pattern'
//resume constant check
public void method1()
@@ -206,7 +208,7 @@ class Example2
//resume constant check
}
}
-
+
To configure a filter so that UNUSED OFF:var
and UNUSED ON: var
marks a
@@ -254,13 +256,14 @@ class Example3
//ILLEGAL OFF: Exception
try {}
- catch(Exception ex) {} // suppressed violation
+ catch(Exception ex) {}
+ // filtered violation above 'Catching 'Exception' is not allowed'
catch(Error err) {} // violation, Catching 'Error' is not allowed
//ILLEGAL ON: Exception
}
}
-
+
To configure a filter so that name of suppressed check mentioned
in comment CSOFF: regexp
@@ -287,14 +290,14 @@ class Example4
int VAR1; // violation, Name 'VAR1' must match pattern '^[a-z][a-zA-Z0-9]*$'
//CSOFF: MemberName
- int VAR2; // suppressed violation
+ int VAR2; // filtered violation 'must match pattern'
//CSON: MemberName
public static final int var3 = 1;
// violation above, 'must match pattern'
//CSOFF: ConstantName
- public static final int var4 = 1; // suppressed violation
+ public static final int var4 = 1; // filtered violation 'must match pattern'
//CSON: ConstantName
public void method1()
@@ -305,13 +308,15 @@ class Example4
//CSOFF: IllegalCatch
try {}
- catch(Exception ex) {} // suppressed violation
- catch(Error err) {} // suppressed violation
+ catch(Exception ex) {}
+ // filtered violation above 'Catching 'Exception' is not allowed'
+ catch(Error err) {}
+ // filtered violation above 'Catching 'Error' is not allowed'
//CSON: IllegalCatch
}
}
-
+
To configure a filter to suppress all audit events between a comment
containing CHECKSTYLE_OFF: ALMOST_ALL
and a comment containing
@@ -338,7 +343,7 @@ class Example5
int VAR1; // violation, Name 'VAR1' must match pattern '^[a-z][a-zA-Z0-9]*$'
//CHECKSTYLE_OFF: ALMOST_ALL
- int VAR2; // suppressed violation
+ int VAR2; // filtered violation 'must match pattern'
//CHECKSTYLE_ON: ALMOST_ALL
public static final int var3 = 1;
@@ -357,13 +362,15 @@ class Example5
//CHECKSTYLE_OFF: ALMOST_ALL
try {}
- catch(Exception ex) {} // suppressed violation
- catch(Error err) {} // suppressed violation
+ catch(Exception ex) {}
+ // filtered violation above 'Catching 'Exception' is not allowed'
+ catch(Error err) {}
+ // filtered violation above 'Catching 'Error' is not allowed'
//CHECKSTYLE_ON: ALMOST_ALL
}
}
-
+
It is possible to specify an ID of checks, so that it can be leveraged by the SuppressionCommentFilter to skip validations. The following examples show how to skip @@ -400,14 +407,14 @@ class Example6 int VAR1; // violation, Name 'VAR1' must match pattern '^[a-z][a-zA-Z0-9]*$' //CSOFF MemberID - int VAR2; // suppressed violation + int VAR2; // filtered violation 'must match pattern' //CSON: MemberID public static final int var3 = 1; // violation above, 'must match pattern' //CSOFF ConstantID - public static final int var4 = 1; // suppressed violation + public static final int var4 = 1; // filtered violation 'must match pattern' //CSON ConstantID public void method1() @@ -418,13 +425,15 @@ class Example6 //CSOFF IllegalID try {} - catch(Exception ex) {} // suppressed violation - catch(Error err) {} // suppressed violation + catch(Exception ex) {} + // filtered violation above 'Catching 'Exception' is not allowed' + catch(Error err) {} + // filtered violation above 'Catching 'Error' is not allowed' //CSON IllegalID } } - +
Example of how to configure the check to suppress checks by name defined in comment.
@@ -449,7 +458,7 @@ class Example7 int VAR1; // violation, Name 'VAR1' must match pattern '^[a-z][a-zA-Z0-9]*$' //csoff MemberName - int VAR2; // suppressed violation + int VAR2; // filtered violation 'must match pattern' //cson MemberName public static final int var3 = 1; @@ -458,23 +467,26 @@ class Example7 //csoff ConstantName //csoff IllegalCatch - public static final int var4 = 1; // suppressed violation + public static final int var4 = 1; // filtered violation 'must match pattern' public void method1() { try {} - catch(Exception ex) {} // suppressed violation + catch(Exception ex) {} + // filtered violation above 'Catching 'Exception' is not allowed' try {} - catch(Exception ex) {} // suppressed violation - catch(Error err) {} // suppressed violation + catch(Exception ex) {} + // filtered violation above 'Catching 'Exception' is not allowed' + catch(Error err) {} + // filtered violation above 'Catching 'Error' is not allowed' } //cson ConstantName //cson IllegalCatch } - +Example depicting use of checkC and checkCPP style comments
@@ -505,7 +517,7 @@ class Example8 // violation above, Name 'must match pattern' /*CHECKSTYLE:OFF*/ - public static final int var4 = 1; // suppressed violation + public static final int var4 = 1; // filtered violation 'must match pattern' /*CHECKSTYLE:ON*/ public void method1() diff --git a/src/site/xdoc/filters/suppressioncommentfilter.xml.template b/src/site/xdoc/filters/suppressioncommentfilter.xml.template index dff3d7b2288..436270f8104 100644 --- a/src/site/xdoc/filters/suppressioncommentfilter.xml.template +++ b/src/site/xdoc/filters/suppressioncommentfilter.xml.template @@ -70,7 +70,7 @@ - +
To configure a filter so that // stop constant
check
and // resume constant check
marks
@@ -86,7 +86,7 @@
-
+
To configure a filter so that UNUSED OFF:var
and UNUSED ON: var
marks a
@@ -103,7 +103,7 @@
-
+
To configure a filter so that name of suppressed check mentioned
in comment CSOFF: regexp
@@ -119,7 +119,7 @@
-
+
To configure a filter to suppress all audit events between a comment
containing CHECKSTYLE_OFF: ALMOST_ALL
and a comment containing
@@ -135,7 +135,7 @@
-
+
It is possible to specify an ID of checks, so that it can be leveraged by the SuppressionCommentFilter to skip validations. The following examples show how to skip @@ -155,7 +155,7 @@ - +
Example of how to configure the check to suppress checks by name defined in comment.
@@ -169,7 +169,7 @@ - +Example depicting use of checkC and checkCPP style comments
diff --git a/src/site/xdoc/filters/suppressionsinglefilter.xml b/src/site/xdoc/filters/suppressionsinglefilter.xml index 1a31e0ed50a..0f9e57eabf7 100644 --- a/src/site/xdoc/filters/suppressionsinglefilter.xml +++ b/src/site/xdoc/filters/suppressionsinglefilter.xml @@ -121,7 +121,7 @@ public class Example1 { int value = 100; // filtered violation ''100' is a magic number' } } - +
To configure a filter to suppress violations of JavadocMethod
and
EqualsAvoidNull
checks in Example2.java
using
@@ -154,7 +154,7 @@ public class Example2 {
// filtered violation below '@return tag should be present'
private int m2(int p1) { return p1; }
}
-
+
To configure a filter to suppress violations of RegexpSinglelineCheck
in Example3.java
using SuppressionSingleFilter
:
@@ -188,7 +188,7 @@ public class Example3 {
}
}
-
+
To configure a filter to suppress violations of NoWhitespaceAfter
in Example4.java
using SuppressionSingleFilter
:
@@ -219,7 +219,7 @@ public class Example4 {
}
}
-
+
To configure a filter to suppress violations of MethodName
in Example5.java
using SuppressionSingleFilter
:
@@ -244,7 +244,7 @@ public class Example5 {
public void Another_Method() {
}
}
-
+
To configure a filter to suppress violations of ConstantName
in Example6.java
using SuppressionSingleFilter
:
@@ -266,7 +266,7 @@ public class Example6 {
private static final int myConstant = 42;
}
-
+
To configure a filter to suppress violations of MemberName
and MethodName
in Example7.java
using
@@ -292,7 +292,7 @@ public class Example7 {
public void MyMethod() {
}
}
-
+
To configure a filter to suppress ParameterNumber
violations
in Example8.java
using SuppressionSingleFilter
:
@@ -319,7 +319,7 @@ public class Example8 {
int param1, int param2, int param3, int param4, int param5, int param6
) {}
}
-
+
To configure a filter to suppress FileLength
violations
in Example9.java
using SuppressionSingleFilter
:
@@ -344,7 +344,7 @@ public class Example8 {
public class Example9 {
}
-
+
To configure a filter to suppress MemberName
violations
in Example10.java
using SuppressionSingleFilter
:
diff --git a/src/site/xdoc/filters/suppressionsinglefilter.xml.template b/src/site/xdoc/filters/suppressionsinglefilter.xml.template
index c3736fa48a7..bea89a4fcb6 100644
--- a/src/site/xdoc/filters/suppressionsinglefilter.xml.template
+++ b/src/site/xdoc/filters/suppressionsinglefilter.xml.template
@@ -61,7 +61,7 @@
-
+
To configure a filter to suppress violations of JavadocMethod
and
EqualsAvoidNull
checks in Example2.java
using
@@ -78,7 +78,7 @@
-
+
To configure a filter to suppress violations of RegexpSinglelineCheck
in Example3.java
using SuppressionSingleFilter
:
@@ -94,7 +94,7 @@
-
+
To configure a filter to suppress violations of NoWhitespaceAfter
in Example4.java
using SuppressionSingleFilter
:
@@ -110,7 +110,7 @@
-
+
To configure a filter to suppress violations of MethodName
in Example5.java
using SuppressionSingleFilter
:
@@ -126,7 +126,7 @@
-
+
To configure a filter to suppress violations of ConstantName
in Example6.java
using SuppressionSingleFilter
:
@@ -142,7 +142,7 @@
-
+
To configure a filter to suppress violations of MemberName
and MethodName
in Example7.java
using
@@ -159,7 +159,7 @@
-
+
To configure a filter to suppress ParameterNumber
violations
in Example8.java
using SuppressionSingleFilter
:
@@ -175,7 +175,7 @@
-
+
To configure a filter to suppress FileLength
violations
in Example9.java
using SuppressionSingleFilter
:
@@ -191,7 +191,7 @@
-
+
To configure a filter to suppress MemberName
violations
in Example10.java
using SuppressionSingleFilter
:
diff --git a/src/site/xdoc/filters/suppressionxpathsinglefilter.xml b/src/site/xdoc/filters/suppressionxpathsinglefilter.xml
index 50de0121d1d..f535d0df9a9 100644
--- a/src/site/xdoc/filters/suppressionxpathsinglefilter.xml
+++ b/src/site/xdoc/filters/suppressionxpathsinglefilter.xml
@@ -111,7 +111,7 @@ public class Example1 {
public void MyMethod() {}
// filtered violation above 'Name 'MyMethod' must match pattern'
}
-
+
To suppress MethodName check for method names matched pattern 'MyMethod[0-9]':
@@ -136,7 +136,7 @@ public class Example2 { // violation below 'Name 'MyMethodA' must match pattern' public void MyMethodA() {} } - +To suppress checks being specified by id property:
@@ -159,7 +159,7 @@ public class Example3 { // filtered violation below 'Name 'MyMethod' must match pattern' public void MyMethod() {} } - +To suppress checks for all package definitions:
@@ -185,7 +185,7 @@ package com.puppycrawl.tools.checkstyle.filters.suppressionxpathsinglefilter; // filtered violation above 'must match pattern' public class Example4 {} - +To suppress RedundantModifier check for interface definitions:
@@ -205,7 +205,7 @@ public class Example4 {} public interface Example5 { public int CONSTANT1 = 1; // filtered violation 'Redundant 'public' modifier.' } - +To suppress checks in the Example6 file by non-query:
@@ -225,7 +225,7 @@ public interface Example5 { public class Example6 { private int field = 177; // filtered violation ''177' is a magic number.' } - +Suppress checks for elements which are either class definitions, or method definitions: @@ -258,7 +258,7 @@ abstract class AnotherClass { public void MyMethod() {} // violation above, 'Name 'MyMethod' must match pattern' } - +
Suppress checks for MyMethod1 or MyMethod2 methods:
@@ -284,7 +284,7 @@ class Example8 { // violation below, 'Name 'MyMethod3' must match pattern' public void MyMethod3() {} } - +Suppress checks for variable testVariable1 inside testMethod method inside Example9 class: @@ -314,7 +314,7 @@ public class Example9 { final int testVariable2 = 10; } } - +
In the following sample, violations for LeftCurly check will be suppressed for methods with name testMethod1 inside @@ -343,7 +343,7 @@ public class Example10 { { // violation, ''{' at column 3 should be on the previous line.' } } - +
The following example demonstrates how to suppress RequireThis violations for variable age inside changeAge method. @@ -377,7 +377,7 @@ public class Example11 { number = number; } } - +
Suppress IllegalThrows
violations only for methods with name
throwsMethod and only for RuntimeException
exceptions.
@@ -409,7 +409,7 @@ public class Example12 {
public void sampleMethod() throws RuntimeException {
}
}
-
+
The following sample demonstrates how to suppress all violations for method itself and
all descendants. descendant-or-self
axis iterates through current node and
@@ -449,7 +449,7 @@ public class Example13 {
final int num = 10;
}
}
-
+
The following example is an example of what checks would be suppressed while building Spring projects with checkstyle plugin. diff --git a/src/site/xdoc/filters/suppressionxpathsinglefilter.xml.template b/src/site/xdoc/filters/suppressionxpathsinglefilter.xml.template index cb963c28aa5..a27fcf41386 100644 --- a/src/site/xdoc/filters/suppressionxpathsinglefilter.xml.template +++ b/src/site/xdoc/filters/suppressionxpathsinglefilter.xml.template @@ -60,7 +60,7 @@ - +
To suppress MethodName check for method names matched pattern 'MyMethod[0-9]':
@@ -74,7 +74,7 @@ - +To suppress checks being specified by id property:
@@ -88,7 +88,7 @@ - +To suppress checks for all package definitions:
@@ -102,7 +102,7 @@ - +To suppress RedundantModifier check for interface definitions:
@@ -116,7 +116,7 @@ - +To suppress checks in the Example6 file by non-query:
@@ -130,7 +130,7 @@ - +Suppress checks for elements which are either class definitions, or method definitions: @@ -145,7 +145,7 @@ - +
Suppress checks for MyMethod1 or MyMethod2 methods:
@@ -159,7 +159,7 @@ - +Suppress checks for variable testVariable1 inside testMethod method inside Example9 class: @@ -174,7 +174,7 @@ - +
In the following sample, violations for LeftCurly check will be suppressed for methods with name testMethod1 inside @@ -190,7 +190,7 @@ - +
The following example demonstrates how to suppress RequireThis violations for variable age inside changeAge method. @@ -205,7 +205,7 @@ - +
Suppress IllegalThrows
violations only for methods with name
throwsMethod and only for RuntimeException
exceptions.
@@ -224,7 +224,7 @@
-
+
The following sample demonstrates how to suppress all violations for method itself and
all descendants. descendant-or-self
axis iterates through current node and
@@ -242,7 +242,7 @@
-
+
The following example is an example of what checks would be suppressed
while building Spring projects with checkstyle plugin.
diff --git a/src/site/xdoc/filters/suppresswarningsfilter.xml b/src/site/xdoc/filters/suppresswarningsfilter.xml
index 7b8e85788dd..6fdea6d0ea2 100644
--- a/src/site/xdoc/filters/suppresswarningsfilter.xml
+++ b/src/site/xdoc/filters/suppresswarningsfilter.xml
@@ -73,7 +73,7 @@ public class Example1 {
validations near code that has @SuppressWarnings("checkstyle:<ID>")
or
just @SuppressWarnings("<ID>")
annotation, where ID is the ID of checks
you want to suppress.
-
Example of suppression by prefix "checkstyle:":
<module name="Checker">
diff --git a/src/site/xdoc/filters/suppresswarningsfilter.xml.template b/src/site/xdoc/filters/suppresswarningsfilter.xml.template
index 3ed5b269d06..e603f154dfb 100644
--- a/src/site/xdoc/filters/suppresswarningsfilter.xml.template
+++ b/src/site/xdoc/filters/suppresswarningsfilter.xml.template
@@ -59,7 +59,7 @@
validations near code that has @SuppressWarnings("checkstyle:<ID>")
or
just @SuppressWarnings("<ID>")
annotation, where ID is the ID of checks
you want to suppress.
-
+
Example of suppression by prefix "checkstyle:":
To configure a filter to suppress all audit events on any line
containing the comment CHECKSTYLE IGNORE THIS LINE
:
@@ -138,7 +138,7 @@ public class Example1 {
public class Example2 {
public static final int lowerCaseConstant = 1; // CHECKSTYLE IGNORE THIS LINE
}
-
+
To configure a filter so that
// OK to catch (Throwable|Exception|RuntimeException) here
@@ -170,7 +170,7 @@ public class Example3 {
}
}
}
-
+
To configure a filter so that
CHECKSTYLE IGNORE check FOR NEXTvar LINES
@@ -200,7 +200,7 @@ public class Example4 {
static final int lowerCaseConstant4 = 4;
static final int lowerCaseConstant5 = 5; // violation 'must match pattern'
}
-
+
To configure a filter to avoid any audits on code like:
@@ -222,8 +222,7 @@ public class Example5 { private int D2; // ALLOW MemberName ON PREVIOUS LINE } - - +
To configure a filter to allow suppress one or more Checks
(separated by "|") and demand comment no less than 14 symbols:
@@ -255,7 +254,7 @@ public class Example6 {
show how to skip validations near code that has comment like
// @cs-: <ID/> (reason)
, where ID is the ID of checks you want to
suppress.
-
Example of Checkstyle checks and SuppressWithNearbyCommentFilter configuration (idFormat which @@ -296,7 +295,7 @@ public class Example7 { System.out.println("Debug info."); // @cs-: systemout (should not fail) } } - +
Example of how to configure the check to suppress more than one checks. The influence format is specified in the second regexp group. diff --git a/src/site/xdoc/filters/suppresswithnearbycommentfilter.xml.template b/src/site/xdoc/filters/suppresswithnearbycommentfilter.xml.template index 34a7b6b4d81..cb3ea967a5c 100644 --- a/src/site/xdoc/filters/suppresswithnearbycommentfilter.xml.template +++ b/src/site/xdoc/filters/suppresswithnearbycommentfilter.xml.template @@ -59,7 +59,7 @@ - +
To configure a filter to suppress all audit events on any line
containing the comment CHECKSTYLE IGNORE THIS LINE
:
@@ -74,7 +74,7 @@
-
+
To configure a filter so that
// OK to catch (Throwable|Exception|RuntimeException) here
@@ -91,7 +91,7 @@
-
+
To configure a filter so that
CHECKSTYLE IGNORE check FOR NEXTvar LINES
@@ -108,7 +108,7 @@
-
+
To configure a filter to avoid any audits on code like:
@@ -122,8 +122,7 @@ - - +
To configure a filter to allow suppress one or more Checks
(separated by "|") and demand comment no less than 14 symbols:
@@ -145,7 +144,7 @@
show how to skip validations near code that has comment like
// @cs-: <ID/> (reason)
, where ID is the ID of checks you want to
suppress.
-
Example of Checkstyle checks and SuppressWithNearbyCommentFilter configuration (idFormat which @@ -162,7 +161,7 @@ - +
Example of how to configure the check to suppress more than one checks. The influence format is specified in the second regexp group. diff --git a/src/site/xdoc/filters/suppresswithnearbytextfilter.xml b/src/site/xdoc/filters/suppresswithnearbytextfilter.xml index f7ed57f7fa3..f7f46bee7ee 100644 --- a/src/site/xdoc/filters/suppresswithnearbytextfilter.xml +++ b/src/site/xdoc/filters/suppresswithnearbytextfilter.xml @@ -91,7 +91,7 @@ public class Example1 { int hoursInDay = 24; // SUPPRESS CHECKSTYLE because it is too obvious int daysInWeek = 7; // violation, "'7' is a magic number." } - +
To configure the filter to suppress audit events on any line that contains
DO NOT CHECK THIS LINE
:
@@ -114,7 +114,7 @@ public class Example2 {
int a = 42; // DO NOT CHECK THIS LINE
int b = 43; // violation, "'43' is a magic number."
}
-
+
To configure the filter to suppress audit events whose check message contains
the word Line
. In this case, LineLengthCheck
's violation
@@ -139,7 +139,7 @@ public class Example3 {
// ok, because violation message is matching suppress pattern
int a_really_long_variable_name = 10;
}
-
+
To configure the filter to suppress audit events only on a check whose id is
ignoreMe
:
@@ -168,7 +168,7 @@ public class Example4 {
static final int LONG_VAR_NAME_TO_TAKE_MORE_THAN_55_CHARS = 22;
// violation above 'Line is longer ...'
}
-
+
To configure the filter to suppress audit events for the current and next 2 lines:
@@ -189,7 +189,7 @@ key.one=42 # ok as within line range key.one=43 # ok as within line range key.two=44 # // violation 'Duplicated property 'key.two' (2 occurrence(s)).' key.two=45 - +To configure the filter to suppress audit events for the current and previous line:
@@ -209,7 +209,7 @@ key.one=41 # ok as within line range key.one=42 # SUPPRESS CHECKSTYLE because I want to key.two=43 # // violation 'Duplicated property 'key.two' (2 occurrence(s)).' key.two=44 - +
To configure the filter with a more compact nearbyTextPattern
to accept variable checkPattern
:
@@ -234,7 +234,7 @@ public class Example7 {
int a = 42; // -@cs[MagicNumber] We do not consider this number as magic.
int b = 43; // violation "'43' is a magic number."
}
-
+
To configure the filter to accept variable checkPattern
and lineRange
:
@@ -263,7 +263,7 @@ public class Example8 {
int d = 45;
int e = 46; // violation "'46' is a magic number."
}
-
+
To configure the filter to suppress LineLength
violations for lines containing a URL:
diff --git a/src/site/xdoc/filters/suppresswithnearbytextfilter.xml.template b/src/site/xdoc/filters/suppresswithnearbytextfilter.xml.template
index 98710859d37..e4fa8de6ebd 100644
--- a/src/site/xdoc/filters/suppresswithnearbytextfilter.xml.template
+++ b/src/site/xdoc/filters/suppresswithnearbytextfilter.xml.template
@@ -47,7 +47,7 @@
-
+
To configure the filter to suppress audit events on any line that contains
DO NOT CHECK THIS LINE
:
@@ -64,7 +64,7 @@
-
+
To configure the filter to suppress audit events whose check message contains
the word Line
. In this case, LineLengthCheck
's violation
@@ -82,7 +82,7 @@
-
+
To configure the filter to suppress audit events only on a check whose id is
ignoreMe
:
@@ -99,7 +99,7 @@
-
+
To configure the filter to suppress audit events for the current and next 2 lines:
@@ -115,7 +115,7 @@ - +To configure the filter to suppress audit events for the current and previous line:
@@ -131,7 +131,7 @@ - +
To configure the filter with a more compact nearbyTextPattern
to accept variable checkPattern
:
@@ -148,7 +148,7 @@
-
+
To configure the filter to accept variable checkPattern
and lineRange
:
@@ -165,7 +165,7 @@
-
+
To configure the filter to suppress LineLength
violations for lines containing a URL:
diff --git a/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml b/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml
index 864ba39227f..ace4ea376bd 100644
--- a/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml
+++ b/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml
@@ -123,7 +123,7 @@ keyB=value2
# // violation below 'Duplicated property 'keyC' (2 occurrence(s)).'
keyC=value4
keyC=value5
-
+
To configure a filter to suppress audit events between a comment
containing STOP CHECK
and a comment
@@ -153,7 +153,7 @@ keyB=value2
# // violation below 'Duplicated property 'keyC' (2 occurrence(s)).'
keyC=value4
keyC=value5
-
+
To configure a filter to suppress UniqueProperties check audit events between a comment
containing STOP UNIQUE CHECK
and a comment containing
@@ -189,7 +189,7 @@ keyA=value3
# // violation below 'Duplicated property 'keyC' (2 occurrence(s)).'
keyC=value4
keyC=value5
-
+
To configure a filter to suppress audit events for the check mentioned in the comment
CSOFF: regexp
and CSON: regexp
.
@@ -233,7 +233,7 @@ keyC=value5
-->
</macro>
</project>
-
+
To configure a filter to suppress all audit events between a comment
containing CSOFF: ALMOST_ALL
and a comment containing
@@ -280,7 +280,7 @@ keyC=value5
-->
</macro>
</project>
-
+
To configure a filter to suppress audit events that match a
specific message in the messageFormat (allowing suppression not only by the
@@ -341,7 +341,7 @@ keyC=value5
The following examples show how to suppress audit events in code surrounded
by CSOFF <ID> (reason)
and CSON <ID>
,
where ID is the ID of the check you want to suppress.
-
Example of Checkstyle checks and SuppressWithPlainTextCommentFilter configuration - the checkFormat, set to '$1', indicates that the ID of the check @@ -395,7 +395,7 @@ keyC=value5 <!-- CSON typeCode --> </macro> </project> - +
Example of how to configure the check to suppress more than one check. Checker is configured to check only SQL files using RegexpSingleline check to detect @@ -433,7 +433,7 @@ FROM users AS u JOIN jobs AS j ON u.job_id = j.id -- suppressed violation below (LineLengthCheck) WHERE u.registration_date >= '2023-01-01' AND u.status = 'active'; - +
This check is not limited to comments. It can match any symbols in the given file
as offCommentFormat
and onCommentFormat
for suppression.
diff --git a/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml.template b/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml.template
index 6196a1f63bf..66ba9c20ce0 100644
--- a/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml.template
+++ b/src/site/xdoc/filters/suppresswithplaintextcommentfilter.xml.template
@@ -74,7 +74,7 @@
-
+
To configure a filter to suppress audit events between a comment
containing STOP CHECK
and a comment
@@ -91,7 +91,7 @@
-
+
To configure a filter to suppress UniqueProperties check audit events between a comment
containing STOP UNIQUE CHECK
and a comment containing
@@ -109,7 +109,7 @@
-
+
To configure a filter to suppress audit events for the check mentioned in the comment
CSOFF: regexp
and CSON: regexp
.
@@ -126,7 +126,7 @@
-
+
To configure a filter to suppress all audit events between a comment
containing CSOFF: ALMOST_ALL
and a comment containing
@@ -145,7 +145,7 @@
-
+
To configure a filter to suppress audit events that match a
specific message in the messageFormat (allowing suppression not only by the
@@ -172,7 +172,7 @@
The following examples show how to suppress audit events in code surrounded
by CSOFF <ID> (reason)
and CSON <ID>
,
where ID is the ID of the check you want to suppress.
-
Example of Checkstyle checks and SuppressWithPlainTextCommentFilter configuration - the checkFormat, set to '$1', indicates that the ID of the check @@ -191,7 +191,7 @@ - +
Example of how to configure the check to suppress more than one check. Checker is configured to check only SQL files using RegexpSingleline check to detect @@ -208,7 +208,7 @@ - +
This check is not limited to comments. It can match any symbols in the given file
as offCommentFormat
and onCommentFormat
for suppression.
diff --git a/src/site/xdoc/index.xml.vm b/src/site/xdoc/index.xml.vm
index f5f578fb9b4..86eeb77dfaf 100644
--- a/src/site/xdoc/index.xml.vm
+++ b/src/site/xdoc/index.xml.vm
@@ -171,52 +171,6 @@
- Since Checkstyle 7, some users have been unable to continue upgrading to newer versions - of the utility because of the new JDK compile requirements. The development team doesn't - have the resources to keep updating the utility for older JDKs for those that can't - work with the latest version. -
-- However, some members of the community have created an unofficial backport of the latest - Checkstyle releases to be run with older JDKs. It is not always an easy process and provided - at the same release time as Checkstyle, but it tries to maintain a functional equivalent - alternative. -
-Backport version | -Min. JRE version | -Link | -
---|---|---|
- 10.0+ - | -- 8 - | -- github site - | -
- 7.0 - 8.45 - | -- 6 - | -- github site - | -
Checkstyle can parse all Java language features introduced diff --git a/src/site/xdoc/releasenotes.xml b/src/site/xdoc/releasenotes.xml index 7b8187036c4..71153c4a04f 100644 --- a/src/site/xdoc/releasenotes.xml +++ b/src/site/xdoc/releasenotes.xml @@ -10,6 +10,188 @@
+Bug fixes:
+Notes:
+New:
diff --git a/src/site/xdoc/sponsoring.xml b/src/site/xdoc/sponsoring.xml index 7b44d75aa05..ccef374c289 100644 --- a/src/site/xdoc/sponsoring.xml +++ b/src/site/xdoc/sponsoring.xml @@ -18,16 +18,6 @@
-
-
-
-
-
-
-
-
@@ -61,9 +51,6 @@
-
- freedomsponsors - checkstyle
-
diff --git a/src/site/xdoc/writingchecks.xml b/src/site/xdoc/writingchecks.xml index 74a796ecf4f..1e5c095a564 100644 --- a/src/site/xdoc/writingchecks.xml +++ b/src/site/xdoc/writingchecks.xml @@ -691,6 +691,12 @@ public class MethodLimitCheck extends AbstractCheck
@Getter
or @Data
. See
+ issue #13538
+ for more details and potential workarounds.
+ In addition to Java files, there are similar limitations that apply to all @@ -724,7 +730,6 @@ public class MethodLimitCheck extends AbstractCheck - a Check that validate that user custom Exception class inherited from java.lang.Exception class.
-- The difference is that Java grammar uses ANTLR v2, while Javadoc grammar uses ANTLR v4. - Because of that, these two grammars and their trees are not compatible. - Java AST consists of - DetailAST - objects, while Javadoc AST consists of - DetailNode - objects. -
Our Java grammar ignores whitespace in most cases, since Java itself does not care about whitespace; however, whitespace is critical in Javadocs. For this reason, our Javadoc AST diff --git a/src/site/xdoc/writinglisteners.xml.vm b/src/site/xdoc/writinglisteners.xml.vm index 9e63731db1f..8aaf945b552 100644 --- a/src/site/xdoc/writinglisteners.xml.vm +++ b/src/site/xdoc/writinglisteners.xml.vm @@ -9,6 +9,12 @@
+
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java
index ac7c7ef1088..048346ff53a 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java
@@ -69,7 +69,7 @@
public class MainTest {
private static final String SHORT_USAGE = String.format(Locale.ROOT,
- "Usage: checkstyle [OPTIONS]... FILES...%n"
+ "Usage: checkstyle [OPTIONS]... file(s) or folder(s) ...%n"
+ "Try 'checkstyle --help' for more information.%n");
private static final String USAGE = String.format(Locale.ROOT,
@@ -78,13 +78,13 @@ public class MainTest {
+ " [-o=