Skip to content

Commit

Permalink
Add Eclipse project settings and adjust accordingly
Browse files Browse the repository at this point in the history
- Formatter settings
- Checkstyle
- Findbugs
- Untrack .project and .classpath
  • Loading branch information
ferstl committed Jun 1, 2016
1 parent 0740615 commit a50ce2f
Show file tree
Hide file tree
Showing 32 changed files with 1,880 additions and 210 deletions.
11 changes: 11 additions & 0 deletions .checkstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
<local-check-config name="Checkstyle Checks" location=".settings/checkstyle-settings.xml" type="project" description="">
<additional-data name="protect-config-file" value="false"/>
</local-check-config>
<fileset name="all" enabled="true" check-config-name="Checkstyle Checks" local="true">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
<filter name="DerivedFiles" enabled="true"/>
</fileset-config>
26 changes: 0 additions & 26 deletions .classpath

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.project
.classpath
/target
23 changes: 0 additions & 23 deletions .project

This file was deleted.

132 changes: 132 additions & 0 deletions .settings/checkstyle-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?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">

<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: Checkstyle Checks
Description: none
-->
<module name="Checker">
<property name="severity" value="warning"/>
<module name="TreeWalker">
<module name="FileContentsHolder"/>
<module name="JavadocStyle">
<property name="scope" value="package"/>
</module>
<module name="JavadocType">
<property name="severity" value="ignore"/>
<property name="scope" value="public"/>
<property name="tokens" value="INTERFACE_DEF"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="ConstantName">
<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$|^logger$"/>
</module>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName">
<property name="format" value="^(?!shutdown$)[a-z][a-zA-Z0-9]*$"/>
</module>
<module name="MethodTypeParameterName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport"/>
<module name="IllegalImport">
<property name="illegalPkgs" value="sun,com.sun,sunw,org.apache.log4j.spi,freemarker.log,org.hibernate,org.apache.log4j,java.util.logging,ch.qos.logback.classic,org.apache.commons.logging"/>
</module>
<module name="AnonInnerLength">
<property name="max" value="100"/>
</module>
<module name="MethodLength"/>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="MethodParamPad"/>
<module name="ParenPad"/>
<module name="TypecastParenPad">
<property name="tokens" value="RPAREN,TYPECAST"/>
</module>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
</module>
<module name="GenericWhitespace"/>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<module name="LeftCurly">
<property name="maxLineLength" value="120"/>
</module>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="InnerAssignment"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="NestedIfDepth">
<property name="max" value="3"/>
</module>
<module name="DefaultComesLast"/>
<module name="CovariantEquals"/>
<module name="ModifiedControlVariable"/>
<module name="MultipleVariableDeclarations"/>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
<property name="publicMemberPattern" value="(^serialVersionUID)|(^expectedException.*)|(^temporaryFolder.*)"/>
</module>
<module name="ArrayTypeStyle"/>
<module name="UpperEll"/>
<module name="RegexpSinglelineJava">
<property name="format" value="new\s+String\s*[(]\s*&quot;"/>
<property name="message" value="Possible redundant String object"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="new\s+BigDecimal\s*[(]\s*\d"/>
<property name="message" value="Avoid non-String BigDecimal constructors"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="OuterTypeNumber"/>
<module name="MutableException"/>
<module name="AnnotationUseStyle"/>
<module name="ClassTypeParameterName"/>
<module name="EmptyStatement"/>
<module name="NoFinalizer"/>
<module name="UnnecessaryParentheses"/>
<module name="DeclarationOrder">
<property name="ignoreModifiers" value="true"/>
</module>
<module name="IllegalInstantiation">
<property name="classes" value="java.lang.Boolean,java.lang.Integer,java.lang.Double,java.lang.Float"/>
</module>
<module name="MissingDeprecated"/>
<module name="SuppressWarnings">
<property name="format" value="^null$"/>
<property name="tokens" value="CLASS_DEF,INTERFACE_DEF,ENUM_DEF,ANNOTATION_DEF,ANNOTATION_FIELD_DEF,ENUM_CONSTANT_DEF,METHOD_DEF,CTOR_DEF"/>
</module>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="checkstyle\:off"/>
<property name="onCommentFormat" value="checkstyle\:on"/>
</module>
</module>
174 changes: 174 additions & 0 deletions .settings/fb-excludes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<?xml version="1.0" ?>
<FindBugsFilter>
<!-- findbugs exclusion file -->
<!-- with Java 1.5 comparable is generic -->
<Match>
<Bug pattern="CO_ABSTRACT_SELF"></Bug>
</Match>
<Match>
<Bug pattern="CO_SELF_NO_OBJECT"></Bug>
</Match>
<!-- we don't write Java SE applications -->
<Match>
<Bug pattern="DM_EXIT"></Bug>
</Match>
<!-- should be caught by Java 1.5 generic collections -->
<Match>
<Bug pattern="GC_UNCHECKED_TYPE_IN_GENERIC_CALL"></Bug>
</Match>
<!-- we use serialization rarely with collections with custom comparators -->
<Match>
<Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE"></Bug>
</Match>
<!-- default disable at NCA -->
<Match>
<Bug pattern="SE_NO_SERIALVERSIONID"></Bug>
</Match>
<!-- set up of TestCase is empty -->
<Match>
<Bug pattern="IJU_SETUP_NO_SUPER"></Bug>
</Match>
<!-- tear down of TestCase is empty -->
<Match>
<Bug pattern="IJU_TEARDOWN_NO_SUPER"></Bug>
</Match>
<!-- seems buggy in 1.3.9 -->
<Match>
<Bug pattern="IL_INFINITE_LOOP"></Bug>
</Match>
<!-- seems buggy in 1.3.9 -->
<Match>
<Bug pattern="NP_UNWRITTEN_FIELD"></Bug>
</Match>
<Match>
<Bug pattern="NP_ALWAYS_NULL"></Bug>
</Match>
<!-- seems buggy in 1.3.9 -->
<Match>
<Bug pattern="UWF_UNWRITTEN_FIELD"></Bug>
</Match>
<Match>
<Bug pattern="URF_UNREAD_FIELD"></Bug>
</Match>
<!-- we don't use JUL -->
<Match>
<Bug pattern="LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE"></Bug>
</Match>
<!-- doesn't seem to be stable in 1.3.9 -->
<Match>
<Bug pattern="OBL_UNSATISFIED_OBLIGATION"></Bug>
</Match>
<!-- too much pain for the gain -->
<Match>
<Bug pattern="EI_EXPOSE_REP"></Bug>
</Match>
<Match>
<Bug pattern="EI_EXPOSE_REP2"></Bug>
</Match>
<Match>
<Bug pattern="EI_EXPOSE_STATIC_REP2"></Bug>
</Match>
<Match>
<Bug pattern="MS_CANNOT_BE_FINAL"></Bug>
</Match>
<Match>
<Bug pattern="MS_EXPOSE_REP"></Bug>
</Match>
<Match>
<Bug pattern="MS_MUTABLE_ARRAY"></Bug>
</Match>
<Match>
<Bug pattern="MS_MUTABLE_HASHTABLE"></Bug>
</Match>
<!-- unsure about these two -->
<Match>
<Bug pattern="WA_AWAIT_NOT_IN_LOOP"></Bug>
</Match>
<Match>
<Bug pattern="WA_NOT_IN_LOOP"></Bug>
</Match>
<!-- convenience seems to outweight the cost -->
<Match>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"></Bug>
</Match>
<!-- potentially too much noise -->
<Match>
<Bug pattern="BC_UNCONFIRMED_CAST"></Bug>
</Match>
<!-- may still be preferrable to fall-through -->
<Match>
<Bug pattern="DB_DUPLICATE_SWITCH_CLAUSES"></Bug>
</Match>
<Match>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS"></Bug>
</Match>
<Match>
<Bug pattern="IM_AVERAGE_COMPUTATION_COULD_OVERFLOW"></Bug>
</Match>
<!-- allowed by checkstyle -->
<Match>
<Bug pattern="SF_SWITCH_FALLTHROUGH"></Bug>
</Match>
<!-- for enums having a default makes little sense -->
<Match>
<Bug pattern="SF_SWITCH_NO_DEFAULT"></Bug>
</Match>
<!-- only a problem if there really is a subclass -->
<Match>
<Bug pattern="SE_PRIVATE_READ_RESOLVE_NOT_INHERITED"></Bug>
</Match>
<!-- too many false positives -->
<Match>
<Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"></Bug>
</Match>
<!-- buggy with java 7 -->
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"></Bug>
</Match>
<!-- Many tests pass null on purpose -->
<Match>
<Class name="~.*Test$" />
<Bug pattern="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS"></Bug>
</Match>
<!-- Many tests pass null on purpose -->
<Match>
<Class name="~.*Test$" />
<Bug pattern="NP_NULL_PARAM_DEREF_NONVIRTUAL"></Bug>
</Match>
<!-- new with fb 2 -->
<!-- can easily be tricked with -->
<!-- BigDecimal testBigDecimal(double d) {return new BigDecimal(d);} -->
<Match>
<Bug pattern="DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE"></Bug>
</Match>
<!-- we don't allow public or protected fields -->
<Match>
<Bug pattern="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"></Bug>
</Match>
<Match>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"></Bug>
</Match>
<Match>
<Bug pattern="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"></Bug>
</Match>
<Match>
<Bug pattern="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"></Bug>
</Match>
<!-- superseeded by OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE -->
<Match>
<Bug pattern="OS_OPEN_STREAM"></Bug>
</Match>
<Match>
<Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"></Bug>
</Match>
<Match>
<Bug pattern="ODR_OPEN_DATABASE_RESOURCE"></Bug>
</Match>
<Match>
<Bug pattern="ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH"></Bug>
</Match>
<!-- already checked by Eclipse "assignment has no effect" -->
<Match>
<Bug pattern="SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD"></Bug>
</Match>
</FindBugsFilter>
Loading

0 comments on commit a50ce2f

Please sign in to comment.