Skip to content

Commit

Permalink
Issue #451: adds NewlineAtEndOfFile
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach authored and Calixte committed Jan 28, 2023
1 parent 1b2d9d8 commit 74e9af6
Show file tree
Hide file tree
Showing 18 changed files with 96 additions and 95 deletions.
1 change: 1 addition & 0 deletions config/checkstyle_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
</module>

<!-- Miscellaneous -->
<module name="NewlineAtEndOfFile"/>
<module name="UniqueProperties"/>

<!-- Regexp -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ public final class CheckstyleMarker {
private CheckstyleMarker() {
// NOOP
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,72 +29,72 @@

/**
* Interface for a check configuration object.
*
*
* @author Lars Ködderitzsch
*/
public interface ICheckConfiguration {

/**
* Returns the displayable name of the configuration.
*
*
* @return the displayable name of the configuration
*/
String getName();

/**
* Return a description of the check configuration.
*
*
* @return a description.
*/
String getDescription();

/**
* Returns the location of the checkstyle configuration file.
*
*
* @return the location of the configuration file
*/
String getLocation();

/**
* Return the type of the configuration.
*
*
* @return the configuration type
*/
IConfigurationType getType();

/**
* Gets additional data for this configuration.
*
*
* @return the additional data in form of a Map
*/
Map<String, String> getAdditionalData();

/**
* Returns the list of properties added to the configuration.
*
*
* @return the list of configured properties
*/
List<ResolvableProperty> getResolvableProperties();

/**
* Determines if the configuration properties are editable by the user.
*
*
* @return <code>true</code>, if the configuration is editable
*/
boolean isEditable();

/**
* Determines if the checkstyle configuration associates with this check configuration can be
* configured.
*
*
* @return <code>true</code> if the checkstyle configuration can be configured.
*/
boolean isConfigurable();

/**
* Returns if the check configuration is a global configuration, configured for the workspace, or
* a local configuration for a single project.
*
*
* @return <code>true</code> if the check configuration is configured globally
*/
boolean isGlobal();
Expand All @@ -103,7 +103,7 @@ public interface ICheckConfiguration {
* Returns the resolved location URL of the Checkstyle configuration file configured for this
* check configuration. Clients should not try to open an actual stream to the configuration file,
* since this is not guaranteed to work.
*
*
* @return the Checkstyle configuration file location as URL
* @throws CheckstylePluginException
* exception while resolving the URL
Expand All @@ -113,10 +113,10 @@ public interface ICheckConfiguration {
/**
* Get all data of the Checkstyle configuration (file data, additional properties...) in one go.
* This is done to optimize the number of accesses that must be done on the configuration files.
*
*
* @return all Checkstyle configuration file data necessary to create a checker
* @throws CheckstylePluginException
* exception while getting the Checkstyle configuration file data
*/
CheckstyleConfigurationFile getCheckstyleConfiguration() throws CheckstylePluginException;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Interface for implementations that provide editing services for a group of check configuration.
*
*
* @author Lars Ködderitzsch
*/
public interface ICheckConfigurationWorkingSet {
Expand All @@ -38,7 +38,7 @@ public interface ICheckConfigurationWorkingSet {
* Creates a new working copy for an existing check configuration. The working copy is associated
* with this working set albeit the new working copy is not added to the working sets list of
* workin copies.
*
*
* @param checkConfig
* the check configuration to create the working copy for
* @return the working copy
Expand All @@ -49,7 +49,7 @@ public interface ICheckConfigurationWorkingSet {
* Creates a new working copy with a given configuration type. The working copy is associated with
* this working set albeit the new working copy is not added to the working sets list of workin
* copies.
*
*
* @param configType
* the desired configuration type of the new working copy
* @return the working copy
Expand All @@ -58,15 +58,15 @@ public interface ICheckConfigurationWorkingSet {

/**
* Returns the working copies that belong to this working set.
*
*
* @return the working copies
*/
CheckConfigurationWorkingCopy[] getWorkingCopies();

/**
* Checks if the name of a check configuration (in form of a working copy) clashes with an
* existing configuration. Names of check configurations must be unique within the working copy.
*
*
* @param configuration
* the working copy to check
* @return <code>true</code> if there is a collision, <code>false</code> otherwise
Expand All @@ -75,7 +75,7 @@ public interface ICheckConfigurationWorkingSet {

/**
* Adds a working copy to the working set.
*
*
* @param checkConfig
* the working copy to add
*/
Expand All @@ -84,7 +84,7 @@ public interface ICheckConfigurationWorkingSet {
/**
* Removes a working copy from the working set. Returns <code>true</code> if the configuration
* could be removed, <code>false</code> if it could not be removed because it is being used.
*
*
* @param checkConfig
* the working copy to remove
* @return <code>true</code> if the configuration was removed, <code>false</code> if it is being
Expand All @@ -94,25 +94,25 @@ public interface ICheckConfigurationWorkingSet {

/**
* Stores the working set (it configurations) to persistence.
*
*
* @throws CheckstylePluginException
* when storing of the configurations failed
*/
void store() throws CheckstylePluginException;

/**
* Determines if the working set changed.
*
*
* @return <code>true</code> if the working set changed, <code>false</code> otherwise
*/
boolean isDirty();

/**
* Returns a collection of projects affected by the changes of the working set.
*
*
* @return the collection of affected projects
* @throws CheckstylePluginException
* unexprected error
*/
Collection<IProject> getAffectedProjects() throws CheckstylePluginException;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,4 @@ public Module clone() {
throw new InternalError(ex);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Class that provides all known tokens from the checkstyle java grammar. This is used for modules
* that allow all tokens as options - which is very tedious to maintain in the metadata.
*
*
* @author Lars Ködderitzsch
*/
public class AllTokensProvider implements IOptionProvider {
Expand All @@ -54,11 +54,11 @@ public class AllTokensProvider implements IOptionProvider {

/**
* Returns all options.
*
*
* @return the options
*/
@Override
public List<String> getOptions() {
return sAllOptions;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ConfigPropertyMetadata {

/**
* Creates the property metadata.
*
*
* @param type
* the property type
* @param name
Expand All @@ -71,7 +71,7 @@ public ConfigPropertyMetadata(ConfigPropertyType type, String name, String defau

/**
* Get the property's datatype.
*
*
* @return The datatype
*/
public ConfigPropertyType getDatatype() {
Expand All @@ -80,7 +80,7 @@ public ConfigPropertyType getDatatype() {

/**
* Get the property's name.
*
*
* @return The name
*/
public String getName() {
Expand All @@ -89,7 +89,7 @@ public String getName() {

/**
* Get the property's description.
*
*
* @return The description
*/
public String getDescription() {
Expand All @@ -98,7 +98,7 @@ public String getDescription() {

/**
* Sets the description of this property.
*
*
* @param description
* the description
*/
Expand All @@ -108,7 +108,7 @@ public void setDescription(String description) {

/**
* Get the default value.
*
*
* @return The default value
*/
public String getDefaultValue() {
Expand All @@ -117,7 +117,7 @@ public String getDefaultValue() {

/**
* Returns a default value differing from the Checkstye default for this property.
*
*
* @return The differing checkstyle default value.
*/
public String getOverrideDefault() {
Expand All @@ -126,7 +126,7 @@ public String getOverrideDefault() {

/**
* Get the enumeration of allowable values.
*
*
* @return Enumeration of values
*/
public List<String> getPropertyEnumeration() {
Expand All @@ -135,11 +135,11 @@ public List<String> getPropertyEnumeration() {

/**
* Returns the hidden.
*
*
* @return boolean
*/
public boolean isHidden() {
return ConfigPropertyType.Hidden.equals(mDatatype);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ public enum ConfigPropertyType {

/** A value that contains a regular expression. */
Regex
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
* Interface for an option provider. This is used to provide dynamic or massive amount of options
* which would be too difficult to handle in metadata. For instance this is true for module metadata
* that need all token types as options.
*
*
* @author Lars Ködderitzsch
*/
public interface IOptionProvider {

/**
* Returns a list of options.
*
*
* @return the options
*/
List<String> getOptions();
}
}
Loading

0 comments on commit 74e9af6

Please sign in to comment.