Skip to content

Commit b6063a3

Browse files
committed
Issue #451: add LineLength to checkstyle config
1 parent 1304fe5 commit b6063a3

86 files changed

Lines changed: 360 additions & 227 deletions

File tree

Some content is hidden

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

config/checkstyle-checks.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@
250250
<module name="FileLength">
251251
<property name="fileExtensions" value="java"/>
252252
</module>
253+
<module name="LineLength">
254+
<property name="fileExtensions" value="java"/>
255+
<property name="max" value="100"/>
256+
<property name="ignorePattern"
257+
value="^( *\* *([^ ]+|\{@code .*|&lt;a href=&quot;[^&quot;]+&quot;&gt;)|(package|import) .*)$"/>
258+
</module>
253259

254260
<!-- Whitespace -->
255261
<module name="FileTabCharacter">

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/CheckstylePlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class CheckstylePlugin extends Plugin {
4343
public static final String PLUGIN_ID = "net.sf.eclipsecs.core"; //$NON-NLS-1$
4444

4545
/** Extension point id for Checkstyle addon providers. */
46-
private static final String ADDON_PROVIDER_EXT_PT_ID = PLUGIN_ID + ".checkstyleAddonProvider"; //$NON-NLS-1$
46+
private static final String ADDON_PROVIDER_EXT_PT_ID = PLUGIN_ID + ".checkstyleAddonProvider";
4747

4848
/**
4949
* Platform Locale.
@@ -70,7 +70,7 @@ public void start(BundleContext context) throws Exception {
7070
ADDON_PROVIDER_EXT_PT_ID);
7171

7272
try {
73-
Logger checkstyleErrorLog = Logger.getLogger("com.puppycrawl.tools.checkstyle.ExceptionLog"); //$NON-NLS-1$
73+
Logger checkstyleErrorLog = Logger.getLogger("com.puppycrawl.tools.checkstyle.ExceptionLog");
7474

7575
checkstyleErrorLog.addHandler(new EclipseLogHandler(this));
7676
checkstyleErrorLog.setLevel(Level.ALL);

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/CheckstylePluginPrefs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class CheckstylePluginPrefs extends AbstractPreferenceInitializer {
5050
* Preference name indicating if the number of checkstyle warning generated per file should be
5151
* limited.
5252
*/
53-
public static final String PREF_LIMIT_MARKERS_PER_RESOURCE = "limit.markers.per.resource"; //$NON-NLS-1$
53+
public static final String PREF_LIMIT_MARKERS_PER_RESOURCE = "limit.markers.per.resource";
5454

5555
/**
5656
* Preference name for the preference that stores the limit of markers per resource.

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/builder/CheckstyleBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
public class CheckstyleBuilder extends IncrementalProjectBuilder {
6666

6767
/** Eclipse extension point ID for the builder. */
68-
public static final String BUILDER_ID = CheckstylePlugin.PLUGIN_ID + ".CheckstyleBuilder"; //$NON-NLS-1$
68+
public static final String BUILDER_ID = CheckstylePlugin.PLUGIN_ID + ".CheckstyleBuilder";
6969

7070
/**
7171
* Run the Checkstyle builder on all open projects in the workspace.
@@ -305,8 +305,8 @@ private <T extends IResource> Map<CheckConfiguration, Auditor> resolveAudits(
305305
* @throws CoreException
306306
* an unexpected error occurred
307307
*/
308-
private Collection<IResource> getResources(final IResourceDelta delta, final List<AuditFilter> filters)
309-
throws CoreException {
308+
private Collection<IResource> getResources(final IResourceDelta delta,
309+
final List<AuditFilter> filters) throws CoreException {
310310

311311
List<IResource> resources = new ArrayList<>();
312312

@@ -356,8 +356,8 @@ private Collection<IResource> getResources(final IResourceDelta delta, final Lis
356356
* @throws CoreException
357357
* an unexpected error occurred
358358
*/
359-
private Collection<IResource> getResources(final IContainer container, final List<AuditFilter> filters)
360-
throws CoreException {
359+
private Collection<IResource> getResources(final IContainer container,
360+
final List<AuditFilter> filters) throws CoreException {
361361

362362
List<IResource> resources = new ArrayList<>();
363363

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/builder/CheckstyleMarker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131
public final class CheckstyleMarker {
3232
/** ID for the CheckstyleMarker. */
33-
public static final String MARKER_ID = CheckstylePlugin.PLUGIN_ID + ".CheckstyleMarker"; //$NON-NLS-1$
33+
public static final String MARKER_ID = CheckstylePlugin.PLUGIN_ID + ".CheckstyleMarker";
3434

3535
/** Module name key in marker attributes. */
3636
public static final String MODULE_NAME = "ModuleName"; //$NON-NLS-1$

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ private CheckConfigurationTester() {
5656
* @throws CheckstylePluginException
5757
* most likely the configuration file could not be found
5858
*/
59-
public static List<ResolvableProperty> getUnresolvedProperties(CheckConfiguration checkConfiguration)
60-
throws CheckstylePluginException {
59+
public static List<ResolvableProperty> getUnresolvedProperties(
60+
CheckConfiguration checkConfiguration) throws CheckstylePluginException {
6161

6262
CheckstyleConfigurationFile configFile = checkConfiguration.getCheckstyleConfiguration();
6363

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ public CheckConfigurationWorkingCopy(ConfigurationType configType,
114114
CheckConfigurationWorkingSet workingSet, boolean global) {
115115

116116
mWorkingSet = workingSet;
117-
mCheckConfiguration = new DefaultCheckConfiguration(null, null, null, configType, global, null, null);
117+
mCheckConfiguration = new DefaultCheckConfiguration(null, null, null, configType, global, null,
118+
null);
118119
}
119120

120121
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ private ConfigurationReader() {
123123
}
124124

125125
/**
126-
* Reads the checkstyle configuration from the given stream and returns a list of all modules within
127-
* this configuration.
126+
* Reads the checkstyle configuration from the given stream and returns a list of all modules
127+
* within this configuration.
128128
*
129129
* @param input
130130
* the stream the configuration is loaded from

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ public static void write(OutputStream out, List<Module> modules, CheckConfigurat
9292

9393
String lineSeperator = System.lineSeparator();
9494

95-
String comment = lineSeperator
96-
+ " This configuration file was written by the eclipse-cs plugin configuration editor" //$NON-NLS-1$
97-
+ lineSeperator;
95+
String comment = lineSeperator + " This configuration file was written by "
96+
+ "the eclipse-cs plugin configuration editor" + lineSeperator;
9897
doc.addComment(comment);
9998

10099
// write out name and description as comment
@@ -231,12 +230,11 @@ private static Element writeModule(Module module, Branch parent) {
231230
* @return the list of child modules
232231
*/
233232
private static List<Module> getChildModules(Module module, List<Module> remainingModules) {
234-
235233
List<Module> childModules = new ArrayList<>();
236234

237235
for (Module tmp : remainingModules) {
238-
239-
String parentInternalName = module != null ? module.getMetaData().identity().internalName() : null;
236+
String parentInternalName = module != null ? module.getMetaData().identity().internalName()
237+
: null;
240238
String childParent = tmp.getMetaData().identity().parent();
241239

242240
// only the checker module has no parent

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public class DefaultCheckConfiguration extends AbstractCheckConfiguration {
8383
* @param additionalData
8484
* a map of additional data for this configuration
8585
*/
86-
public DefaultCheckConfiguration(final String name, final String location, final String description,
87-
final ConfigurationType type, final boolean global,
86+
public DefaultCheckConfiguration(final String name, final String location,
87+
final String description, final ConfigurationType type, final boolean global,
8888
final List<ResolvableProperty> properties, final Map<String, String> additionalData) {
8989
mName = name;
9090
mLocation = location;

0 commit comments

Comments
 (0)