Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Issue #451: adds trailing whitespace forbidden #462

Merged
merged 1 commit into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/checkstyle_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@
<property name="matchAcrossLines" value="true" />
<property name="message" value="Empty file is not allowed" />
</module>
<module name="RegexpSingleline">
<property name="id" value="noTrailingWhitespace"/>
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Trailing whitespace is not allowed"/>
</module>
<!--
Links to .dtd files should start with "/", "http://" or "https://",
otherwise they will be broken after archiving the documentation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
"http://eclipse-cs.sourceforge.net/dtds/checkstyle-metadata_1_0.dtd">
-->

<!--
<!--
Root element for every metadata definition.
-->
<!ELEMENT checkstyle-metadata (rule-group-metadata+)>


<!--
<!--
Used to specify a group of rules.

The 'name' attribute is used as display name and is translatable.

The 'priority' influences the order in which groups appear in the configuration editor.

The 'hidden' attribut can be used to hide an entire group.
-->
<!ELEMENT rule-group-metadata (description?,rule-metadata*)>
Expand All @@ -35,24 +35,24 @@
<!ELEMENT description (#PCDATA)>


<!--
<!--
'rule-metadata' elements are used to define the metadata for a check (or filter) module.
The 'name' attribute is used as display name and is translatable.

The 'internal-name' attribute defines the logical name of the module.

The 'parent' element defines if the module is a file set check (Checker as parent)
or a regular 'TreeWalker' check.

The 'hasSeverity' attribute specifies if a module has a severity property that can be set.
Some modules (like filters) have no severity property.
The 'hidden' attribute is used to hide a module, so it cannot be seen or

The 'hidden' attribute is used to hide a module, so it cannot be seen or
configured in the configuration editor. This is only used for some special modules
like FileContentsHolder. The attribut defaults to 'false'.
The 'deletable' attribute is used to specify if the module can be removed from the
configuration via the configuration editor. This only makes sense for some

The 'deletable' attribute is used to specify if the module can be removed from the
configuration via the configuration editor. This only makes sense for some
special modules like Checker or TreeWalker, which must be present. Therefore
this attribute default to 'false'.

Expand All @@ -70,12 +70,12 @@
singleton (true|false) "false">


<!--
Every 'rule-metadata' element must have at least one 'alternative-name' child
<!--
Every 'rule-metadata' element must have at least one 'alternative-name' child
element, which describes under which name the module might occur in a configuration
file as well. As you may know you can specify modules in a Checkstyle configuration
file using the logical module name or the fully qualified class name.
This means that this element is used to map the fully qualified module class name
This means that this element is used to map the fully qualified module class name
to this module.
You are able to provide multiple alternative names, which might be useful if
your package structure for your modules changed over time. In this case specify
Expand All @@ -92,17 +92,17 @@
'property-metadata' elements are used to describe the properties of a checkstyle
module. Properties described this way can then be configured using the plugins
configuration editor.

The 'name' attributes specifies the name of the property.

The 'datatype' attribute determines which kind of data the property contains.

The 'default-value' attribute is used to specify the default value of the property.

The 'override-default-value' attribute can be used to specify a default value that
differs from the Checkstyle default. For instance this is used to provide different
defaults for the logLoadError and suppressLoadError properties of the AbstractTypeAware checks.

Properties of data type 'MultiCheck' and 'SingleSelect' can (better must) be provided
with an 'enumeration' child element which specifies the valid enumeration values for
this property.
Expand All @@ -121,7 +121,7 @@
Either the enumeration values are defined using 'property-value-option' child elements
or by an option provider.
An option provider is a java class that implements the interface
'net.sf.eclipsecs.config.meta.IOptionProvider' and provides the
'net.sf.eclipsecs.config.meta.IOptionProvider' and provides the
enumeration values via implementation. This can be useful for providing large amounts
of enumeration values (for instance all checkstyle tokens) or reoccurring sequences of
enumeration values (for instance the java visibility values).
Expand All @@ -139,11 +139,11 @@
<!ELEMENT property-value-option EMPTY>
<!ATTLIST property-value-option
value CDATA #REQUIRED>

<!--
Defines a marker resolution (quickfix) for the module.
Quickfixes are required to implement the
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
Quickfixes are required to implement the
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
interface.
-->
<!ELEMENT quickfix EMPTY>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
"http://eclipse-cs.sourceforge.net/dtds/checkstyle-metadata_1_1.dtd">
-->

<!--
<!--
Root element for every metadata definition.
-->
<!ELEMENT checkstyle-metadata (rule-group-metadata+)>


<!--
<!--
Used to specify a group of rules.
The 'name' attribute is used as display name and is translatable.
The 'priority' influences the order in which groups appear in the configuration editor.
The 'hidden' attribut can be used to hide an entire group.
-->
<!ELEMENT rule-group-metadata (description?,rule-metadata*)>
Expand All @@ -35,24 +35,24 @@
<!ELEMENT description (#PCDATA)>


<!--
<!--
'rule-metadata' elements are used to define the metadata for a check (or filter) module.
The 'name' attribute is used as display name and is translatable.
The 'internal-name' attribute defines the logical name of the module.
The 'parent' element defines if the module is a file set check (Checker as parent)
or a regular 'TreeWalker' check.
The 'hasSeverity' attribute specifies if a module has a severity property that can be set.
Some modules (like filters) have no severity property.
The 'hidden' attribute is used to hide a module, so it cannot be seen or
The 'hidden' attribute is used to hide a module, so it cannot be seen or
configured in the configuration editor. This is only used for some special modules
like FileContentsHolder. The attribut defaults to 'false'.
The 'deletable' attribute is used to specify if the module can be removed from the
configuration via the configuration editor. This only makes sense for some
The 'deletable' attribute is used to specify if the module can be removed from the
configuration via the configuration editor. This only makes sense for some
special modules like Checker or TreeWalker, which must be present. Therefore
this attribute default to 'false'.
Expand All @@ -70,12 +70,12 @@
singleton (true|false) "false">


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

<!--
Defines a marker resolution (quickfix) for the module.
Quickfixes are required to implement the
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
Quickfixes are required to implement the
net.sf.eclipsecs.quickfixes.ICheckstyleMarkerResolution
interface.
-->
<!ELEMENT quickfix EMPTY>
Expand All @@ -154,5 +154,5 @@
Defines the message keys used by this module.
-->
<!ELEMENT message-key EMPTY>
<!ATTLIST message-key
<!ATTLIST message-key
key NMTOKEN #REQUIRED>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* Simple object containing all sort of data of a Checkstyle configuration. This is done to not
* access the Checkstyle configuration file too many times to get small bits of information.
*
*
* @author Lars Ködderitzsch
*/
public class CheckstyleConfigurationFile {
Expand All @@ -47,7 +47,7 @@ public class CheckstyleConfigurationFile {

/**
* Returns an input stream containing the contents of the Checkstyle configuration file.
*
*
* @return the input stream containing the Checkstyle configuration file
*/
public ByteArrayInputStream getCheckConfigFileStream() {
Expand All @@ -57,7 +57,7 @@ public ByteArrayInputStream getCheckConfigFileStream() {
/**
* Returns a SAX input source of the Checkstyle configuration file. The resolved URL of the
* configuration file will be set as SystemId to allow for parser resolution of relative entities.
*
*
* @return a SAX input source of the
*/
public InputSource getCheckConfigFileInputSource() {
Expand All @@ -70,7 +70,7 @@ public InputSource getCheckConfigFileInputSource() {

/**
* Sets the content of the Checkstyle configuration file as a byte array.
*
*
* @param checkConfigFileBytes
* the Checkstyle configuration file contents
*/
Expand All @@ -80,7 +80,7 @@ public void setCheckConfigFileBytes(byte[] checkConfigFileBytes) {

/**
* Returns an <code>ByteArrayInputStream</code> of the addional property bundle.
*
*
* @return the stream containing the bundle data
*/
public ByteArrayInputStream getAdditionalPropertiesBundleStream() {
Expand All @@ -93,7 +93,7 @@ public ByteArrayInputStream getAdditionalPropertiesBundleStream() {
/**
* Sets the content of an addtional property bundle which contains values for property references
* in the Checkstyle configuration file.
*
*
* @param additionalPropertyBundleBytes
* the content of the additional property bundle
*/
Expand All @@ -103,7 +103,7 @@ public void setAdditionalPropertyBundleBytes(byte[] additionalPropertyBundleByte

/**
* Returns the modification timestamp or 0 if none can be determined.
*
*
* @return the modification timestamp of the Checkstyle configuration file
*/
public long getModificationStamp() {
Expand All @@ -112,7 +112,7 @@ public long getModificationStamp() {

/**
* Sets the modification timestamp of the Checkstyle configuration file.
*
*
* @param modificationStamp
* the modification timestamp
*/
Expand All @@ -123,7 +123,7 @@ public void setModificationStamp(long modificationStamp) {
/**
* Returns the resolved URL of the Checkstyle configuration file. Clients are expected to
* <b>not</b> use this to access the underlying Checkstyle configuration file
*
*
* @return the resolved URL
*/
public URL getResolvedConfigFileURL() {
Expand All @@ -132,7 +132,7 @@ public URL getResolvedConfigFileURL() {

/**
* Sets the resolved URL of the Checkstyle configuration file.
*
*
* @param resolvedConfigFileURL
* the resolved URL
*/
Expand All @@ -142,7 +142,7 @@ public void setResolvedConfigFileURL(URL resolvedConfigFileURL) {

/**
* Returns the property resolver or <code>null</code> if none has been set.
*
*
* @return the property resolver
*/
public PropertyResolver getPropertyResolver() {
Expand All @@ -151,7 +151,7 @@ public PropertyResolver getPropertyResolver() {

/**
* Sets the property resolver for this Checkstyle configuration.
*
*
* @param propertyResolver
* the property resolver
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Enumeration for Checkstyle's severity levels. The intent is to decouple highler level funtions
* (UI) from dealing with Checkstyle code API.
*
*
* @author Lars Ködderitzsch
*/
public enum Severity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@

/**
* Interface to implement special module logic.
*
*
* @author Lars Ködderitzsch
*/
public interface ISaveFilter {

/**
* Post processes the selection of configurad modules. This can be used to add/remove certain
* 'special' modules. Implementations are encouraged to manipulate the list of configured modules.
*
*
* @param configuredModules
* the configured modules in from this configuration
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* Job to de-couple an audit. Used for the "Run Checkstyle in background on full build"
* functionality.
*
*
* @author Lars Ködderitzsch
*/
public class AuditorJob extends WorkspaceJob implements ISchedulingRule {
Expand All @@ -48,7 +48,7 @@ public class AuditorJob extends WorkspaceJob implements ISchedulingRule {

/**
* Creates an operation which runs a pre-configured auditor.
*
*
* @param project
* the project to build
* @param auditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

/**
* Job who starts transforming the formatter-rules to checkstyle-settings.
*
*
* @author Lukas Frena
*
*
*/
public class TransformFormatterRulesJob extends WorkspaceJob {

Expand Down
Loading