Checkstyle for Jalview
----------------------
+See
+https://issues.jalview.org/browse/JAL-1854
http://checkstyle.sourceforge.net/
GNU LGPL
- Help | Eclipse Marketplace
- search for checkstyle
- install eclipse-cs checkstyle plugin
-The current version is 6.19.1 (August 2016).
+Change Log
+----------
+See http://checkstyle.sourceforge.net/releasenotes.html
+Aug 2016 Initial version used is 6.19.1
+Dec 2018 Updated to 8.12.0 (latest on Eclipse Marketplace, 8.15 is latest release)
+ SuppressionCommentFilter relocated (changed in 8.1)
+ FileContentsHolder removed (changed in 8.2)
+ Updates to import-control.xml for code changes (htsjdk, stackoverflowusers)
+
Config
------
Option 2: on demand on selected code
- right-click on a class or package and Checkstyle | Check code with checkstyle
- (or Clear Checkstyle violations to remove checkstyle warnings)
+ - recommended to use this as a QA step when changing or reviewing code
Checkstyle rules
----------------
Tips
----
Sometimes checkstyle needs a kick before it will refresh its findings.
- A whitespace edit in checkstyle.xml usually does this. There may be better ways.
+ Click the 'refresh' icon at top right in Eclipse | Preferences | Checkstyle.
Invalid configuration files may result in checkstyle failing with an error reported
in the Eclipse log file.
- Help | Installation Details | Configuration takes you to a screen with a
+ Eclipse | About | Installation Details | Configuration takes you to a screen with a
'View Error Log' button.
Sometimes checkstyle can fail silently. Try 'touching' (editing) config files, failing
<suppress checks="[a-zA-Z0-9]*" files="[\\/]ext[\\/]edu*"/>
<suppress checks="[a-zA-Z0-9]*" files="[\\/]ext[\\/]vamsas*"/>
<suppress checks="[a-zA-Z0-9]*" files="[\\/]org[\\/]jibble*"/>
+ <suppress checks="[a-zA-Z0-9]*" files="[\\/]org[\\/]stackoverflowusers*"/>
<suppress checks="[a-zA-Z0-9]*" files="[\\/]uk[\\/]ac*"/>
<!--
</module>
<!--
- Allow suppression of rules by comments, e.g.:
- // CHECKSTYLE.OFF: ParameterNumber
- ..method declaration
- // CHECKSTYLE.ON: ParameterNumber
- -->
- <module name="SuppressionCommentFilter">
- <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
- <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
- <property name="checkFormat" value="$1"/>
- </module>
-
- <!--
Check language bundles have the same keys and no duplicates
(ensure Checkstyle is configured to scan non-source files)
-->
<property name="tabWidth" value="4"/>
<!--
- Enables parsing of suppressions comments
- see http://checkstyle.sourceforge.net/config_filters.html#SuppressionCommentFilter
+ Allow suppression of rules by comments, e.g.:
+ // CHECKSTYLE.OFF: ParameterNumber
+ ..method declaration
+ // CHECKSTYLE.ON: ParameterNumber
-->
- <module name="FileContentsHolder"/>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
<!-- ****************************** -->
<!-- NAMING STANDARDS -->
<allow pkg="compbio.metadata" class="jalview.gui.WsJobParameters"/>
<allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarna"/>
<allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarnaBinding"/>
+ <allow pkg="org.stackoverflowusers.file" class="jalview.gui.Desktop"/>
<allow pkg="uk.ac.vamsas" class="jalview.gui.VamsasApplication"/>
</subpackage>
<allow pkg="uk.ac.vamsas"/>
<allow pkg="fr.orsay.lri.varna"/>
<allow pkg="MCview"/>
+ <subpackage name="vcf">
+ <allow pkg="htsjdk\.*" regex="true"/>
+ </subpackage>
</subpackage>
<subpackage name="javascript">