Skip to content

Commit bd64683

Browse files
rnveachromani
authored andcommitted
Issue #451: adds trailing whitespace forbidden
1 parent 596c951 commit bd64683

File tree

57 files changed

+204
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+204
-197
lines changed

config/checkstyle_checks.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@
8181
<property name="matchAcrossLines" value="true" />
8282
<property name="message" value="Empty file is not allowed" />
8383
</module>
84+
<module name="RegexpSingleline">
85+
<property name="id" value="noTrailingWhitespace"/>
86+
<property name="format" value="\s+$"/>
87+
<property name="minimum" value="0"/>
88+
<property name="maximum" value="0"/>
89+
<property name="message" value="Trailing whitespace is not allowed"/>
90+
</module>
8491
<!--
8592
Links to .dtd files should start with "/", "http://" or "https://",
8693
otherwise they will be broken after archiving the documentation.

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checkstyle-metadata_1_0.dtd

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
"http://eclipse-cs.sourceforge.net/dtds/checkstyle-metadata_1_0.dtd">
88
-->
99

10-
<!--
10+
<!--
1111
Root element for every metadata definition.
1212
-->
1313
<!ELEMENT checkstyle-metadata (rule-group-metadata+)>
1414

1515

16-
<!--
16+
<!--
1717
Used to specify a group of rules.
18-
18+
1919
The 'name' attribute is used as display name and is translatable.
20-
20+
2121
The 'priority' influences the order in which groups appear in the configuration editor.
22-
22+
2323
The 'hidden' attribut can be used to hide an entire group.
2424
-->
2525
<!ELEMENT rule-group-metadata (description?,rule-metadata*)>
@@ -35,24 +35,24 @@
3535
<!ELEMENT description (#PCDATA)>
3636

3737

38-
<!--
38+
<!--
3939
'rule-metadata' elements are used to define the metadata for a check (or filter) module.
4040
The 'name' attribute is used as display name and is translatable.
41-
41+
4242
The 'internal-name' attribute defines the logical name of the module.
43-
43+
4444
The 'parent' element defines if the module is a file set check (Checker as parent)
4545
or a regular 'TreeWalker' check.
46-
46+
4747
The 'hasSeverity' attribute specifies if a module has a severity property that can be set.
4848
Some modules (like filters) have no severity property.
49-
50-
The 'hidden' attribute is used to hide a module, so it cannot be seen or
49+
50+
The 'hidden' attribute is used to hide a module, so it cannot be seen or
5151
configured in the configuration editor. This is only used for some special modules
5252
like FileContentsHolder. The attribut defaults to 'false'.
53-
54-
The 'deletable' attribute is used to specify if the module can be removed from the
55-
configuration via the configuration editor. This only makes sense for some
53+
54+
The 'deletable' attribute is used to specify if the module can be removed from the
55+
configuration via the configuration editor. This only makes sense for some
5656
special modules like Checker or TreeWalker, which must be present. Therefore
5757
this attribute default to 'false'.
5858
@@ -70,12 +70,12 @@
7070
singleton (true|false) "false">
7171

7272

73-
<!--
74-
Every 'rule-metadata' element must have at least one 'alternative-name' child
73+
<!--
74+
Every 'rule-metadata' element must have at least one 'alternative-name' child
7575
element, which describes under which name the module might occur in a configuration
7676
file as well. As you may know you can specify modules in a Checkstyle configuration
7777
file using the logical module name or the fully qualified class name.
78-
This means that this element is used to map the fully qualified module class name
78+
This means that this element is used to map the fully qualified module class name
7979
to this module.
8080
You are able to provide multiple alternative names, which might be useful if
8181
your package structure for your modules changed over time. In this case specify
@@ -92,17 +92,17 @@
9292
'property-metadata' elements are used to describe the properties of a checkstyle
9393
module. Properties described this way can then be configured using the plugins
9494
configuration editor.
95-
95+
9696
The 'name' attributes specifies the name of the property.
97-
97+
9898
The 'datatype' attribute determines which kind of data the property contains.
99-
99+
100100
The 'default-value' attribute is used to specify the default value of the property.
101-
101+
102102
The 'override-default-value' attribute can be used to specify a default value that
103103
differs from the Checkstyle default. For instance this is used to provide different
104104
defaults for the logLoadError and suppressLoadError properties of the AbstractTypeAware checks.
105-
105+
106106
Properties of data type 'MultiCheck' and 'SingleSelect' can (better must) be provided
107107
with an 'enumeration' child element which specifies the valid enumeration values for
108108
this property.
@@ -121,7 +121,7 @@
121121
Either the enumeration values are defined using 'property-value-option' child elements
122122
or by an option provider.
123123
An option provider is a java class that implements the interface
124-
'net.sf.eclipsecs.config.meta.IOptionProvider' and provides the
124+
'net.sf.eclipsecs.config.meta.IOptionProvider' and provides the
125125
enumeration values via implementation. This can be useful for providing large amounts
126126
of enumeration values (for instance all checkstyle tokens) or reoccurring sequences of
127127
enumeration values (for instance the java visibility values).
@@ -139,11 +139,11 @@
139139
<!ELEMENT property-value-option EMPTY>
140140
<!ATTLIST property-value-option
141141
value CDATA #REQUIRED>
142-
142+
143143
<!--
144144
Defines a marker resolution (quickfix) for the module.
145-
Quickfixes are required to implement the
146-
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
145+
Quickfixes are required to implement the
146+
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
147147
interface.
148148
-->
149149
<!ELEMENT quickfix EMPTY>

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checkstyle-metadata_1_1.dtd

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
"http://eclipse-cs.sourceforge.net/dtds/checkstyle-metadata_1_1.dtd">
88
-->
99

10-
<!--
10+
<!--
1111
Root element for every metadata definition.
1212
-->
1313
<!ELEMENT checkstyle-metadata (rule-group-metadata+)>
1414

1515

16-
<!--
16+
<!--
1717
Used to specify a group of rules.
1818
1919
The 'name' attribute is used as display name and is translatable.
20-
20+
2121
The 'priority' influences the order in which groups appear in the configuration editor.
22-
22+
2323
The 'hidden' attribut can be used to hide an entire group.
2424
-->
2525
<!ELEMENT rule-group-metadata (description?,rule-metadata*)>
@@ -35,24 +35,24 @@
3535
<!ELEMENT description (#PCDATA)>
3636

3737

38-
<!--
38+
<!--
3939
'rule-metadata' elements are used to define the metadata for a check (or filter) module.
4040
The 'name' attribute is used as display name and is translatable.
4141
4242
The 'internal-name' attribute defines the logical name of the module.
43-
43+
4444
The 'parent' element defines if the module is a file set check (Checker as parent)
4545
or a regular 'TreeWalker' check.
4646
4747
The 'hasSeverity' attribute specifies if a module has a severity property that can be set.
4848
Some modules (like filters) have no severity property.
4949
50-
The 'hidden' attribute is used to hide a module, so it cannot be seen or
50+
The 'hidden' attribute is used to hide a module, so it cannot be seen or
5151
configured in the configuration editor. This is only used for some special modules
5252
like FileContentsHolder. The attribut defaults to 'false'.
5353
54-
The 'deletable' attribute is used to specify if the module can be removed from the
55-
configuration via the configuration editor. This only makes sense for some
54+
The 'deletable' attribute is used to specify if the module can be removed from the
55+
configuration via the configuration editor. This only makes sense for some
5656
special modules like Checker or TreeWalker, which must be present. Therefore
5757
this attribute default to 'false'.
5858
@@ -70,12 +70,12 @@
7070
singleton (true|false) "false">
7171

7272

73-
<!--
74-
Every 'rule-metadata' element must have at least one 'alternative-name' child
73+
<!--
74+
Every 'rule-metadata' element must have at least one 'alternative-name' child
7575
element, which describes under which name the module might occur in a configuration
7676
file as well. As you may know you can specify modules in a Checkstyle configuration
7777
file using the logical module name or the fully qualified class name.
78-
This means that this element is used to map the fully qualified module class name
78+
This means that this element is used to map the fully qualified module class name
7979
to this module.
8080
You are able to provide multiple alternative names, which might be useful if
8181
your package structure for your modules changed over time. In this case specify
@@ -121,7 +121,7 @@
121121
Either the enumeration values are defined using 'property-value-option' child elements
122122
or by an option provider.
123123
An option provider is a java class that implements the interface
124-
'net.sf.eclipsecs.config.meta.IOptionProvider' and provides the
124+
'net.sf.eclipsecs.config.meta.IOptionProvider' and provides the
125125
enumeration values via implementation. This can be useful for providing large amounts
126126
of enumeration values (for instance all checkstyle tokens) or reoccurring sequences of
127127
enumeration values (for instance the java visibility values).
@@ -142,8 +142,8 @@
142142

143143
<!--
144144
Defines a marker resolution (quickfix) for the module.
145-
Quickfixes are required to implement the
146-
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
145+
Quickfixes are required to implement the
146+
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
147147
interface.
148148
-->
149149
<!ELEMENT quickfix EMPTY>
@@ -154,5 +154,5 @@
154154
Defines the message keys used by this module.
155155
-->
156156
<!ELEMENT message-key EMPTY>
157-
<!ATTLIST message-key
157+
<!ATTLIST message-key
158158
key NMTOKEN #REQUIRED>

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/config/CheckstyleConfigurationFile.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/**
3131
* Simple object containing all sort of data of a Checkstyle configuration. This is done to not
3232
* access the Checkstyle configuration file too many times to get small bits of information.
33-
*
33+
*
3434
* @author Lars Ködderitzsch
3535
*/
3636
public class CheckstyleConfigurationFile {
@@ -47,7 +47,7 @@ public class CheckstyleConfigurationFile {
4747

4848
/**
4949
* Returns an input stream containing the contents of the Checkstyle configuration file.
50-
*
50+
*
5151
* @return the input stream containing the Checkstyle configuration file
5252
*/
5353
public ByteArrayInputStream getCheckConfigFileStream() {
@@ -57,7 +57,7 @@ public ByteArrayInputStream getCheckConfigFileStream() {
5757
/**
5858
* Returns a SAX input source of the Checkstyle configuration file. The resolved URL of the
5959
* configuration file will be set as SystemId to allow for parser resolution of relative entities.
60-
*
60+
*
6161
* @return a SAX input source of the
6262
*/
6363
public InputSource getCheckConfigFileInputSource() {
@@ -70,7 +70,7 @@ public InputSource getCheckConfigFileInputSource() {
7070

7171
/**
7272
* Sets the content of the Checkstyle configuration file as a byte array.
73-
*
73+
*
7474
* @param checkConfigFileBytes
7575
* the Checkstyle configuration file contents
7676
*/
@@ -80,7 +80,7 @@ public void setCheckConfigFileBytes(byte[] checkConfigFileBytes) {
8080

8181
/**
8282
* Returns an <code>ByteArrayInputStream</code> of the addional property bundle.
83-
*
83+
*
8484
* @return the stream containing the bundle data
8585
*/
8686
public ByteArrayInputStream getAdditionalPropertiesBundleStream() {
@@ -93,7 +93,7 @@ public ByteArrayInputStream getAdditionalPropertiesBundleStream() {
9393
/**
9494
* Sets the content of an addtional property bundle which contains values for property references
9595
* in the Checkstyle configuration file.
96-
*
96+
*
9797
* @param additionalPropertyBundleBytes
9898
* the content of the additional property bundle
9999
*/
@@ -103,7 +103,7 @@ public void setAdditionalPropertyBundleBytes(byte[] additionalPropertyBundleByte
103103

104104
/**
105105
* Returns the modification timestamp or 0 if none can be determined.
106-
*
106+
*
107107
* @return the modification timestamp of the Checkstyle configuration file
108108
*/
109109
public long getModificationStamp() {
@@ -112,7 +112,7 @@ public long getModificationStamp() {
112112

113113
/**
114114
* Sets the modification timestamp of the Checkstyle configuration file.
115-
*
115+
*
116116
* @param modificationStamp
117117
* the modification timestamp
118118
*/
@@ -123,7 +123,7 @@ public void setModificationStamp(long modificationStamp) {
123123
/**
124124
* Returns the resolved URL of the Checkstyle configuration file. Clients are expected to
125125
* <b>not</b> use this to access the underlying Checkstyle configuration file
126-
*
126+
*
127127
* @return the resolved URL
128128
*/
129129
public URL getResolvedConfigFileURL() {
@@ -132,7 +132,7 @@ public URL getResolvedConfigFileURL() {
132132

133133
/**
134134
* Sets the resolved URL of the Checkstyle configuration file.
135-
*
135+
*
136136
* @param resolvedConfigFileURL
137137
* the resolved URL
138138
*/
@@ -142,7 +142,7 @@ public void setResolvedConfigFileURL(URL resolvedConfigFileURL) {
142142

143143
/**
144144
* Returns the property resolver or <code>null</code> if none has been set.
145-
*
145+
*
146146
* @return the property resolver
147147
*/
148148
public PropertyResolver getPropertyResolver() {
@@ -151,7 +151,7 @@ public PropertyResolver getPropertyResolver() {
151151

152152
/**
153153
* Sets the property resolver for this Checkstyle configuration.
154-
*
154+
*
155155
* @param propertyResolver
156156
* the property resolver
157157
*/

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/config/Severity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* Enumeration for Checkstyle's severity levels. The intent is to decouple highler level funtions
2525
* (UI) from dealing with Checkstyle code API.
26-
*
26+
*
2727
* @author Lars Ködderitzsch
2828
*/
2929
public enum Severity {

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/config/savefilter/ISaveFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626

2727
/**
2828
* Interface to implement special module logic.
29-
*
29+
*
3030
* @author Lars Ködderitzsch
3131
*/
3232
public interface ISaveFilter {
3333

3434
/**
3535
* Post processes the selection of configurad modules. This can be used to add/remove certain
3636
* 'special' modules. Implementations are encouraged to manipulate the list of configured modules.
37-
*
37+
*
3838
* @param configuredModules
3939
* the configured modules in from this configuration
4040
*/

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/jobs/AuditorJob.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
/**
3838
* Job to de-couple an audit. Used for the "Run Checkstyle in background on full build"
3939
* functionality.
40-
*
40+
*
4141
* @author Lars Ködderitzsch
4242
*/
4343
public class AuditorJob extends WorkspaceJob implements ISchedulingRule {
@@ -48,7 +48,7 @@ public class AuditorJob extends WorkspaceJob implements ISchedulingRule {
4848

4949
/**
5050
* Creates an operation which runs a pre-configured auditor.
51-
*
51+
*
5252
* @param project
5353
* the project to build
5454
* @param auditor

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/jobs/TransformFormatterRulesJob.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737

3838
/**
3939
* Job who starts transforming the formatter-rules to checkstyle-settings.
40-
*
40+
*
4141
* @author Lukas Frena
42-
*
42+
*
4343
*/
4444
public class TransformFormatterRulesJob extends WorkspaceJob {
4545

0 commit comments

Comments
 (0)