JAL-1854 initial checkstyle config
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 25 Aug 2016 16:11:15 +0000 (17:11 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 25 Aug 2016 16:11:15 +0000 (17:11 +0100)
.checkstyle [new file with mode: 0644]
resources/checkstyle/README.txt [new file with mode: 0644]
resources/checkstyle/checkstyle-suppress.xml [new file with mode: 0644]
resources/checkstyle/checkstyle.xml [new file with mode: 0644]
resources/checkstyle/import-control.xml [new file with mode: 0644]

diff --git a/.checkstyle b/.checkstyle
new file mode 100644 (file)
index 0000000..c2a7260
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
+  <local-check-config name="JalviewCheckstyle" location="resources/checkstyle/checkstyle.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="source" enabled="true" check-config-name="JalviewCheckstyle" local="true">
+    <file-match-pattern match-pattern="src/.*.java" include-pattern="true"/>
+    <file-match-pattern match-pattern="resources/.*.properties" include-pattern="true"/>
+  </fileset>
+  <filter name="NonSrcDirs" enabled="false"/>
+</fileset-config>
diff --git a/resources/checkstyle/README.txt b/resources/checkstyle/README.txt
new file mode 100644 (file)
index 0000000..7ad1268
--- /dev/null
@@ -0,0 +1,65 @@
+Checkstyle for Jalview
+----------------------
+
+http://checkstyle.sourceforge.net/
+GNU LGPL
+
+To get the Eclipse Checkstyle plugin
+------------------------------------
+       - Help | Eclipse Marketplace
+       - search for checkstyle
+       - install eclipse-cs checkstyle plugin
+The current version is 6.19.1 (August 2016).
+
+Config
+------
+
+       File Jalview/.checkstyle holds configuration for the "JalviewCheckstyle" ruleset.
+       This includes confining its scope to src/*.java and resources/*.properties.
+       This can be modified interactively through the checkstyle properties editor.
+       
+       Checkstyle config files in resources/checkstyle:
+               checkstyle.xml          : main configuration file with selected checkstyle modules
+               checkstyle-suppress.xml : rules to exclude certain checks / files
+               import-control.xml      : package import rules
+       
+       Checkstyle error messages can be customised. I've done this for TypeName as an example.
+
+How to use checkstyle
+---------------------
+
+       Option 1: enable it for the Jalview project
+               - right-click on project | Checkstyle | Activate Checkstyle
+               - notice CheckstyleNature gets added to the .project file
+               - don't commit this file unless we all agree to!
+               - Checkstyle will run as you recompile changed code
+               - checking the whole project can be slow and may hang - not recommended for now
+
+       Option 2: on selected code
+               - right-click on a class or package and Checkstyle | Check code with checkstyle
+
+Checkstyle rules
+----------------
+       Documented at http://checkstyle.sourceforge.net/checks.html
+       Should be self-documenting in checkstyle.xml
+       Open for discussion:
+       - which rules to use
+       - what naming and layout standards to apply
+       - settings for complexity metrics
+       - whether any rules should report error instead of warning  
+       
+Gotchas
+-------
+       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.
+       
+       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 
+       'View Error Log' button.
+       
+       Sometimes checkstyle can fail silently. Try 'touching' (editing) config files, failing
+       that, carefully check / back out / redo any recent changes to its config.
+       
+       Putting <!-- XML comments --> inside a checkstyle <module> causes it to be ignored!
+       
\ No newline at end of file
diff --git a/resources/checkstyle/checkstyle-suppress.xml b/resources/checkstyle/checkstyle-suppress.xml
new file mode 100644 (file)
index 0000000..0c1d2ee
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+\r
+<!DOCTYPE suppressions PUBLIC\r
+    "-//Puppy Crawl//DTD Suppressions 1.1//EN"\r
+    "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">\r
+\r
+<suppressions>\r
+       <!-- \r
+               Do not put individual file-level suppressions here.\r
+               Instead use embedded comments to switch checks on and off.\r
+    -->\r
+        \r
+    <!-- \r
+        Suppress check of XML binding generated code packages \r
+    --> \r
+    <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]schemabinding[\\/]*"/>\r
+    <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]binding[\\/]*"/>\r
+    <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]json[\\/]binding[\\/]*"/>\r
+    <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]xml[\\/]binding[\\/]*"/>\r
+        \r
+    <!-- \r
+       Suppress check of externally sourced code \r
+    --> \r
+    <suppress checks="[a-zA-Z0-9]*" files="com[\\/]*"/>\r
+    <suppress checks="[a-zA-Z0-9]*" files="ext[\\/]*"/>\r
+    <suppress checks="[a-zA-Z0-9]*" files="org[\\/]*"/>\r
+    <suppress checks="[a-zA-Z0-9]*" files="uk[\\/]*"/>\r
+    \r
+    <!-- \r
+       ImportControl can only handle one top level package\r
+    -->\r
+    <suppress checks="ImportControl" files="MCview[\\/]*" />\r
+    <suppress checks="ImportControl" files="vamsas[\\/]*" />\r
+    \r
+    <!--  \r
+       Suppress checks by name \r
+    -->\r
+       <suppress checks="FinalLocalVariable" files=".*\.java"/>\r
+    \r
+    <!--  \r
+       Suppress checks by id \r
+    -->\r
+       <suppress id="InterfaceNaming" files=".*\.java"/>\r
+       <suppress id="NoStaticInitialization" files=".*\.java"/>\r
+         \r
+</suppressions>
\ No newline at end of file
diff --git a/resources/checkstyle/checkstyle.xml b/resources/checkstyle/checkstyle.xml
new file mode 100644 (file)
index 0000000..46d4bd7
--- /dev/null
@@ -0,0 +1,560 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+<!--
+       Jalview Checkstyle configuration file
+-->
+<module name="Checker">
+       <!-- Default severity is warning -->
+       <property name="severity" value="warning"/>
+       <property name="fileExtensions" value="java,properties"/>
+
+       <!-- 
+               Add any metrics that you wish to suppress to the following file.
+       -->
+       <module name="SuppressionFilter">
+               <property name="file" value="${basedir}/resources/checkstyle/checkstyle-suppress.xml"/>
+       </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>
+
+       <!--
+               Maximum line count for source files
+       -->
+       <module name="FileLength">
+               <property name="max" value="1200"/>
+               <property name="fileExtensions" value="java"/>
+       </module>
+
+       <!-- 
+               Check language bundles have the same keys and no duplicates
+               (ensure Checkstyle is configured to scan non-source files)
+        -->
+       <module name="Translation">
+               <property name="fileExtensions" value="properties"/>
+               <property name="baseName" value="^Messages.*$"/>
+       </module>
+       <module name="UniqueProperties">
+           <property name="fileExtensions" value="properties" />
+               <property name="severity" value="error"/>
+       </module>
+       
+       <module name="TreeWalker">
+
+               <property name="tabWidth" value="4"/>
+
+               <!-- 
+                       Enables parsing of suppressions comments
+                       see http://checkstyle.sourceforge.net/config_filters.html#SuppressionCommentFilter 
+               -->
+               <module name="FileContentsHolder"/>
+
+       <!-- ****************************** -->
+       <!--         NAMING STANDARDS       -->
+       <!-- ****************************** -->
+               
+               <!--
+                       Naming convention for member fields. Start with (optional) underscore, then
+                       lower case, then camel case; no internal underscores
+               -->
+               <module name="MemberName">
+                       <property name="format" value="^_?[a-z][a-zA-Z0-9]*$"/>
+               </module>
+
+               <!-- 
+                       Naming convention for methods. Start with (optional) underscore, then
+                       lower case, then camel case; no internal underscores
+               -->
+               <module name="MethodName">
+                       <property name="format" value="^_?[a-z]([a-zA-Z0-9]+)*$"/>
+               </module>
+
+               <!--
+                       Name pattern for local final variables.
+               -->
+               <module name="LocalFinalVariableName">
+                       <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+               </module>
+
+               <!--
+                       Name pattern for local variables
+               -->
+               <module name="LocalVariableName">
+                       <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+               </module>
+               
+               <!--
+                       Name pattern for constants (static final fields)
+               -->
+               <module name="ConstantName">
+                       <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+               </module>
+
+               <!--
+                       Name pattern for parameters (note no underscores allowed)
+               -->
+               <module name="ParameterName">
+                       <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+               </module>
+               
+               <!--
+                       Name pattern for static (non-final) fields
+               -->
+               <module name="StaticVariableName">
+                       <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
+               </module>
+               
+               <!--
+                       Name pattern for classes
+               -->
+               <module name="TypeName">
+                       <property name="format" value="[A-Z][a-zA-Z0-9]*$"/>
+                       <property name="tokens" value="CLASS_DEF"/>
+               </module>
+               
+               <!--
+                       Name pattern for interfaces. All interfaces names must end with 'I'.
+                       ** currently suppressed in checkstyle-suppress.xml **
+               -->
+               <module name="TypeName">
+                       <property name="id" value="InterfaceNaming"/>
+                       <property name="format" value="^[A-Z][a-zA-Z0-9]*I$"/>
+                       <property name="tokens" value="INTERFACE_DEF"/>
+                       <message key="name.invalidPattern" value="Interface names should end in a I"/>
+               </module>
+
+               <!--
+                       Java package name pattern 
+               -->
+               <module name="PackageName">
+                       <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+               </module>
+
+       <!-- ****************************** -->
+       <!--         LAYOUT AND STYLE       -->
+       <!-- ****************************** -->
+
+               <!-- 
+                       Only one top level type per source file
+               -->
+               <module name="OuterTypeNumber"/>
+               
+               <!-- 
+                       Ensure a class has a package declaration
+                -->
+               <module name="PackageDeclaration"/>
+               
+               <!--
+                       see http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141855.html#1852
+                       1. Class (static) variables: public, protected, package, private
+                       2. Instance variables: public, protected, package, private
+                       3. Constructors
+                       4. Methods
+                -->
+               <module name="DeclarationOrder"/>
+               
+               <!-- 
+                       Modifier order should conform to JLS
+                       see http://checkstyle.sourceforge.net/config_modifier.html#ModifierOrder 
+                       public protected private abstract static final transient volatile synchronized native strictfp          
+               -->
+               <module name="ModifierOrder"/>
+               
+               <!-- 
+                       Declare variables in separate statements, for readability and bug avoidance
+                -->
+               <module name="MultipleVariableDeclarations"/>
+               
+               <!-- 
+                       Only use blocks within control statements 
+               -->
+               <module name="AvoidNestedBlocks"/>
+               
+               <!-- 
+                       Require at least a comment within a block. 
+                       Note this will accept auto-generated // TODO comments,
+                       (but they should be flagged up by the TodoComment rule)
+               -->
+               <module name="EmptyBlock">
+                       <property name="option" value="text"/>
+               </module>
+               
+               <!-- 
+                       Require braces round all code blocks within if/else/for/do/while 
+               -->
+               <module name="NeedBraces"/>
+               
+               <!--
+                       Disallow empty ';' statements
+               -->
+               <module name="EmptyStatement"/>
+
+               <!-- 
+                       Maximum number of return statements for a method
+               -->
+               <module name="ReturnCount">
+                       <property name="max" value="4"/>
+               </module>
+
+               <!-- 
+                       Don't use modifiers in contexts where their value is not optional,
+                       for example all interface methods are always public
+                       see http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier
+               -->
+               <module name="RedundantModifier"/>
+               
+               <!-- 
+                       Variables whose value is not modified should be declared final, both to show the
+                   program's intent, and to  allow compiler optimisation
+                   ** currently suppressed in checkstyle-suppress.xml **
+                -->            
+               <module name="FinalLocalVariable">
+                       <property name="tokens" value="VARIABLE_DEF" />
+               </module>
+
+               <!-- 
+                       Disallows shorthand of assigning values within an expression 
+               -->
+               <module name="InnerAssignment"/>
+
+               <!-- 
+                       Use Java style array declarations to assist in readability 
+               -->
+               <module name="ArrayTypeStyle"/>
+
+               <!-- 
+                       Use L not l to define a long constant 
+               -->
+               <module name="UpperEll"/>
+
+       <!-- ****************************** -->
+       <!--           SIZE LIMITS          -->
+       <!-- ****************************** -->
+
+               <!--
+                       Maximum line count for methods
+               -->
+               <module name="MethodLength">
+                       <property name="tokens" value="METHOD_DEF"/>
+                       <property name="max" value="50"/>
+                       <property name="countEmpty" value="false"/>
+               </module>
+
+               <!--
+                       Maximum statement count for methods, constructors,
+                       instance initialisation and static initialisation blocks
+               -->
+               <module name="ExecutableStatementCount">
+                       <property name="max" value="30"/>
+                       <property name="tokens" value="METHOD_DEF"/>
+               </module>
+               <module name="ExecutableStatementCount">
+                       <property name="max" value="30"/>
+                       <property name="tokens" value="CTOR_DEF"/>
+               </module>
+               <module name="ExecutableStatementCount">
+                       <property name="max" value="4"/>
+                       <property name="tokens" value="INSTANCE_INIT"/>
+               </module>
+               <module name="ExecutableStatementCount">
+                       <property name="id" value="NoStaticInitialization"/>
+                       <property name="max" value="0"/>
+                       <property name="tokens" value="STATIC_INIT"/>
+               </module>
+
+               <!--
+                       Maximum parameter count for methods 
+               -->
+               <module name="ParameterNumber">
+                       <property name="max" value="5"/>
+               </module>
+
+               <!--
+                       Maximum line length for anonymous inner classes
+               -->
+               <module name="AnonInnerLength">
+                       <property name="max" value="40"/>
+               </module>
+
+       <!-- ****************************** -->
+       <!--            IMPORTS             -->
+       <!-- ****************************** -->
+
+               <!-- 
+                       Ensures that there are no redundant or unused imports.
+                    Should be handled by Save actions if using Eclipse 
+               -->
+               <module name="RedundantImport"/>
+               <module name="UnusedImports"/>
+
+               <!--
+                       Disallow * imports; may also be enforced by IDE Save Actions
+               -->
+               <module name="AvoidStarImport"/>
+
+               <!-- 
+                       Disallow import of sun.* packages as they are not portable 
+               -->
+               <module name="IllegalImport"/>
+
+               <!--
+                       rules as to what packages each package may (not) import
+                       see http://checkstyle.sourceforge.net/config_imports.html#ImportControl 
+               -->
+               <module name="ImportControl">
+                   <property name="file" value="${basedir}/resources/checkstyle/import-control.xml"/>
+                       <property name="severity" value="error"/>
+               </module>
+               
+       <!-- ****************************** -->
+       <!--         CATCH and THROW        -->
+       <!-- ****************************** -->
+
+               <!-- 
+                       Disallow catch of Exception, RunTimeException or Error 
+               -->
+               <module name="IllegalCatch"/>
+
+               <!-- 
+                       Disallow throw of Exception, RunTimeException or Error 
+               -->
+               <module name="IllegalThrows"/>
+
+       <!-- ****************************** -->
+       <!--          CODING CHECKS         -->
+       <!-- ****************************** -->
+
+               <!-- 
+                       Check for use of factory method rather than constructor for specified classes 
+               -->
+               <module name="IllegalInstantiation">
+                       <property name="classes" value="java.lang.Boolean"/>
+               </module>
+               
+               <!--
+                       Check that "string".equals(value) is used rather than value.equals("string")
+               -->
+               <module name="EqualsAvoidNull"/>
+
+               <!--
+                       Check that equals() and hashCode() are always overridden together
+               -->
+               <module name="EqualsHashCode"/>
+               
+               <!-- 
+                       Require switch statements to include a default 
+               -->
+               <module name="MissingSwitchDefault"/>
+               
+               <!-- 
+                       Check that switch default follows all case statements
+                -->
+               <module name="DefaultComesLast">
+                       <property name="severity" value="error"/>
+               </module>
+               
+               <!-- 
+                       Disallows fall-through in switch statements i.e. a case without a break, return, throw or continue 
+                       upgrade this to error once AnnotationRenderer is recoded!
+                -->
+               <module name="FallThrough">
+                       <property name="severity" value="warning"/>
+               </module>
+               
+               <!-- 
+                       Warn if boolean expressions can be simplified 
+               -->
+               <module name="SimplifyBooleanExpression"/>
+
+               <!-- 
+                       Warn if boolean return expressions can be simplified 
+               -->
+               <module name="SimplifyBooleanReturn"/>
+
+               <!--
+                       Classes with only private constructors should be declared final
+               -->
+               <module name="FinalClass"/>
+               
+               <!-- 
+                       Classes with only static methods should not be instantiable,
+                       so should declare a private default constructor.
+               -->
+               <module name="HideUtilityClassConstructor"/>
+               
+               <!-- 
+                       An Interface should declare methods (do not use to define constants only) 
+               -->
+               <module name="InterfaceIsType"/>
+               
+               <!-- 
+                       Disallow public fields in classes (other than constants) 
+               -->
+               <module name="VisibilityModifier">
+                       <property name="packageAllowed" value="true"/>
+                       <property name="allowPublicImmutableFields" value="true"/>
+               </module>
+               
+               <!-- 
+                       Checks that a local variable or a parameter does not shadow a field that is defined in the same class.
+                       Note this should also be configured as a compiler warning in the IDE. 
+               -->
+               <module name="HiddenField"/> 
+
+               <!-- 
+                       Check that proper logging is used and never printing to System.out.
+                       This may be suppressed in the class that provides logging functions.
+               -->
+               <module name="RegexpSinglelineJava">
+                       <property name="format" value="System\.out\.println"/>
+                       <property name="ignoreComments" value="true"/>
+               </module>
+
+               <!--
+                       Checks that classes that define a covariant equals() method also override 
+                       method equals(java.lang.Object).
+                -->
+               <module name="CovariantEquals"/>
+               
+               <!-- 
+                       Checks that there are no "magic numbers" (numeric literals) 
+               -->
+               <module name="MagicNumber">
+                       <property name="ignoreNumbers" value="-1,0,1,2"/>
+               </module>
+               
+               <!-- 
+                       Check that  loop control variables are not modified inside the for block
+                -->
+               <module name="ModifiedControlVariable">
+               </module>
+               
+               <!-- 
+                       Checks that string literals are not used with == or !=.
+                -->
+               <module name="StringLiteralEquality">
+               </module>
+               
+               <!-- 
+                       Checks that clone() invokes super.clone() 
+                -->
+               <module name="SuperClone"/>
+               
+               <!-- 
+                       Checks that finalize() invokes super.finalize()
+                -->
+               <module name="SuperFinalize"/>
+               
+               <!-- 
+                       Disallow assignment of parameters.
+                -->
+               <module name="ParameterAssignment"/>
+
+               <!-- 
+                       Checks for multiple occurrences of the same string literal within a single file.
+                       NB - does not check for the same string in different files.
+                -->
+               <module name="MultipleStringLiterals">
+                       <property name="allowedDuplicates" value="1"/>
+               </module>
+               
+               <!-- 
+                       Checks that exceptions are immutable (have only final fields)
+                -->
+               <module name="MutableException"/>
+
+       <!-- ****************************** -->
+       <!--           COMPLEXITY           -->
+       <!-- ****************************** -->
+               
+               <!-- 
+                       Restrict the number of number of &&, ||, &, |  and ^ in an expression.
+                       Note that the operators & and | are not only integer bitwise operators, they are also the 
+                       non-shortcut versions of the boolean operators && and ||.
+                -->
+               <module name="BooleanExpressionComplexity">
+                       <property name="max" value="3"/>
+               </module>
+               
+               <!-- 
+                       This metric measures the number of instantiations of other classes within the given class. 
+                       The higher the DAC, the more complex the data structure of the system.
+                -->
+               <module name="ClassDataAbstractionCoupling">
+                       <property name="max" value="7"/>
+               </module>
+               
+               <!-- 
+                       The number of other classes a class relies on. A high number indicates over-complex
+                       class interdependencies that might benefit from refactoring.
+                -->
+               <module name="ClassFanOutComplexity">
+               <property name="max" value="10"/>
+       </module>
+               
+               <!-- 
+                       Checks cyclomatic complexity against a specified limit. The complexity is a measure 
+                       of the minimum number of possible paths through the source and therefore the number of required 
+                       tests. Consider re-factoring if at or above 10.
+                -->
+               <module name="CyclomaticComplexity">
+                       <property name="max" value="15"/>
+               </module>
+               
+               <!-- 
+                       The NPATH metric computes the number of possible execution paths through a function. It takes 
+                       into account the nesting of conditional statements and multi-part boolean expressions 
+                       (e.g., A && B, C || D, etc.).
+                -->
+               <module name="NPathComplexity">
+                       <property name="max" value="200"/>
+               </module>
+
+               <!-- 
+                       Maximum number of throws statements in a method
+                -->
+               <module name="ThrowsCount">
+                       <property name="max" value="2"/>
+               </module>
+               
+               <!-- 
+                       Maximum if-else depth
+                -->
+               <module name="NestedIfDepth">
+                       <property name="max" value="4"/>
+               </module>
+
+               <!-- 
+                       Restricts nested try blocks to a specified depth. 
+                -->
+               <module name="NestedTryDepth">
+                       <property name="max" value="2"/>
+               </module>
+
+       <!-- ****************************** -->
+       <!--              TODO              -->
+       <!-- ****************************** -->
+
+               <!-- 
+                       Checks for uncommented main() methods (debugging leftovers)
+                -->
+               <module name="UncommentedMain"/>
+
+               <!-- 
+                       Check for TODO and similar comments 
+               -->
+               <module name="TodoComment">
+                       <property name="format" value="(TODO)|(FIXME)|(DOCUMENT ME)"/>
+               </module>
+
+       </module>
+</module>
diff --git a/resources/checkstyle/import-control.xml b/resources/checkstyle/import-control.xml
new file mode 100644 (file)
index 0000000..36a29f0
--- /dev/null
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE import-control PUBLIC
+    "-//Puppy Crawl//DTD Import Control 1.1//EN"
+    "http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
+    
+    <!--
+       see http://checkstyle.sourceforge.net/config_imports.html#ImportControl
+       allow/disallow rules propagate to sub-packages 
+       unless local-only="true" is specified
+       
+       note this can handle only one top-level package, so ImportControl is
+       suppressed for MCview and vamsas in checkstyle-suppress.xml
+       (all rules are suppressed for com/ext/org/uk)
+    -->
+   <import-control pkg="jalview">
+   
+               <allow pkg="java"/>
+               <allow pkg="jalview"/>
+               <allow pkg="com.stevesoft.pat"/>
+               
+               <subpackage name="appletgui">
+               <disallow pkg="jalview.gui"/>
+               <disallow pkg="jalview.ws"/>
+               <allow pkg="org.jmol"/>
+               <allow pkg="javajs.awt" class="jalview.appletgui.AppletJmolBinding"/>
+           </subpackage>
+               
+               <subpackage name="bin">
+               <allow pkg="groovy"/>
+               <allow pkg="org.apache.log4j" class="jalview.bin.Cache"/>
+               <allow pkg="javax.swing" class="jalview.bin.Jalview"/>
+               <allow pkg="netscape.javascript" class="jalview.bin.JalviewLite"/>
+           </subpackage>
+               
+               <subpackage name="datamodel">
+               <disallow pkg="jalview.gui"/>
+               <allow pkg="fr.orsay.lri.varna"/>
+           </subpackage>
+               
+               <subpackage name="datamodel.xdb.embl">
+               <allow pkg="org.exolab.castor"/>
+           </subpackage>
+               
+               <subpackage name="fts">
+               <allow pkg="javax.swing"/>
+               <allow pkg="javax.ws"/>
+               <allow pkg="org.json"/>
+               <allow pkg="com.sun.jersey"/>
+           </subpackage>
+               
+               <subpackage name="gui">
+               <allow pkg="javax.swing"/>
+               <allow pkg="javax.help"/>
+               <allow pkg="javax.imageio"/>
+               <allow pkg="ext.edu.ucsf"/>
+               <allow pkg="net.miginfocom"/>
+               <allow pkg="org.jibble"/>
+               <allow pkg="org.jmol"/>
+               <allow pkg="org.openscience"/>
+               <allow pkg="org.exolab.castor" class="jalview.gui.Jalview2XML"/>
+               <allow pkg="org.robsite" class="jalview.gui.BlogReader"/>
+               <allow pkg="org.apache.log4j" class="jalview.gui.Console"/>
+               <allow pkg="org.apache.log4j" class="jalview.gui.JalviewAppender"/>
+               <allow pkg="org.biodas" class="jalview.gui.DasSourceBrowser"/>
+               <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="uk.ac.vamsas" class="jalview.gui.VamsasApplication"/>
+           </subpackage>
+               
+               <subpackage name="jbgui">
+               <allow pkg="javax.swing"/>
+               <allow pkg="net.miginfocom"/>
+           </subpackage>
+
+               <subpackage name="httpserver">
+               <allow pkg="javax.servlet"/>
+               <allow pkg="org.eclipse.jetty"/>
+           </subpackage>
+
+               <subpackage name="io">
+               <allow pkg="javax.swing"/>
+               <allow pkg="org.jfree"/>
+               <allow pkg="org.json"/>
+               <allow pkg="org.jsoup"/>
+               <allow pkg="uk.ac.ebi"/>
+               <allow pkg="uk.ac.vamsas"/>
+               <allow pkg="fr.orsay.lri.varna"/>
+               <allow pkg="MCview"/>
+               </subpackage>       
+                               
+               <subpackage name="javascript">
+               <allow pkg="netscape.javascript"/>
+           </subpackage>
+
+               <subpackage name="rest">
+               <allow pkg="javax.servlet"/>
+               </subpackage>
+
+               <subpackage name="structure">
+               <allow pkg="MCview"/>
+               </subpackage>
+
+               <subpackage name="util">
+               <allow pkg="javax.swing"/>
+               <allow pkg="javax.imageio"/>
+               <allow pkg="org.jfree"/>
+               <allow pkg="org.jibble"/>
+               </subpackage>
+
+               <subpackage name="ws">
+               <allow pkg="javax.swing"/>
+               <allow pkg="javax.xml"/>
+               <allow pkg="ext.vamsas"/>
+               <allow pkg="compbio"/>
+               <allow pkg="MCview"/>
+               <allow pkg="org.apache.http"/>
+               <allow pkg="org.apache.james"/>
+               <allow pkg="org.apache.axis"/>
+               <allow pkg="org.biodas.jdas"/>
+               <allow pkg="org.exolab.castor"/>
+               <allow pkg="uk.ac.ebi"/>
+               <allow pkg="vamsas.objects"/>
+               </subpackage>
+
+   </import-control>
\ No newline at end of file