From d298d68e672ce7a153d547a7b8cf44c1bfbe5932 Mon Sep 17 00:00:00 2001
From: Oleg Sukhodolsky
Date: Sun, 11 Jan 2004 04:43:25 +0000
Subject: [PATCH] Added multiLines property for RegexpHeaderCheck. Added
AbstractHeaderCheck - superclass for header checks.
---
docs/config_header.html | 49 +++++---
docs/releasenotes.html | 12 ++
.../checks/AbstractHeaderCheck.java | 106 ++++++++++++++++++
.../tools/checkstyle/InputRegexpHeader1.java | 11 ++
.../tools/checkstyle/InputRegexpHeader2.java | 14 +++
.../tools/checkstyle/InputRegexpHeader3.java | 7 ++
.../tools/checkstyle/InputRegexpHeader4.java | 6 +
.../checkstyle/InputRegexpSmallHeader.java | 6 +
.../tools/checkstyle/regexp.header1 | 5 +
.../tools/checkstyle/regexp.header2 | 7 ++
10 files changed, 207 insertions(+), 16 deletions(-)
create mode 100644 src/checkstyle/com/puppycrawl/tools/checkstyle/checks/AbstractHeaderCheck.java
create mode 100644 src/testinputs/com/puppycrawl/tools/checkstyle/InputRegexpHeader1.java
create mode 100644 src/testinputs/com/puppycrawl/tools/checkstyle/InputRegexpHeader2.java
create mode 100644 src/testinputs/com/puppycrawl/tools/checkstyle/InputRegexpHeader3.java
create mode 100644 src/testinputs/com/puppycrawl/tools/checkstyle/InputRegexpHeader4.java
create mode 100644 src/testinputs/com/puppycrawl/tools/checkstyle/InputRegexpSmallHeader.java
create mode 100644 src/testinputs/com/puppycrawl/tools/checkstyle/regexp.header1
create mode 100644 src/testinputs/com/puppycrawl/tools/checkstyle/regexp.header2
diff --git a/docs/config_header.html b/docs/config_header.html
index edcdfa721..81413694c 100644
--- a/docs/config_header.html
+++ b/docs/config_header.html
@@ -112,18 +112,29 @@ line 5: ////////////////////////////////////////////////////////////////////
For example, consider the following header file:
- Lines 1 and 6 demonstrate a more compact notation for 71 '/' characters. Line 4
- enforces that the copyright notice includes a four digit year. Line 5 is an
- example how to enforce revision control keywords in a file header.
+ Lines 1 and 6 demonstrate a more compact notation for 71 '/'
+ characters. Line 4 enforces that the copyright notice includes a
+ four digit year. Line 5 is an example how to enforce revision
+ control keywords in a file header. Lines 12-14 is a template for
+ javadoc (line 13 is so complecated to remove conflict with
+ and of javadoc comment).
@@ -140,8 +151,8 @@ line 6: /{71}
| null |
- | ignoreLines |
- line numbers to ignore |
+ multiLines |
+ line numbers to repeat (zero or more times) |
list of integers |
{} |
@@ -149,16 +160,22 @@ line 6: /{71}
Example
- To configure the check to use header file "java.header"
- and ignore lines 2, 3, and
- 4:
+ To configure the check to use header file "java.header" and 10 and 13
+ muli-lines:
<module name="RegexpHeader">
<property name="headerFile" value="java.header"/>
- <property name="ignoreLines" value="2, 3, 4"/>
+ <property name="multiLines" value="10, 13"/>
</module>
+
+ Note: ignoreLines property has been
+ removed from this check to simplify it. To make some line
+ optional use "^.*$" regexp for this line.
+
Package
com.puppycrawl.tools.checkstyle.checks
@@ -177,4 +194,4 @@ Copyright © 2002-2003 Oliver Burn. All rights Reserved.