Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable CheckStyle, FindBugs and PMD with the same configurations as https://github.com/realm/realm-java. Also adds the same GitHub template.
- Loading branch information
Showing
8 changed files
with
324 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
> We LOVE to help with any issues or bug you have! | ||
> **Questions**: If you have questions about how to use Realm, please ask on [SO](http://stackoverflow.com/questions/ask?tags=realm) - we monitor the Realm tag. | ||
> **Feature Request**: Just fill in the first two sections below. | ||
> **Bugs**: To help you as fast as possible with an issue or bug please describe your issue and the steps you have taken to reproduce it in as many details as possible. | ||
> | ||
> Thanks for helping us help you :-) | ||
> | ||
> Remove this and above before submitting. | ||
#### Goal | ||
|
||
> What do you want to achieve? | ||
#### Expected Results | ||
|
||
> ? | ||
#### Actual Results | ||
|
||
> E.g. full stack trace with exception | ||
#### Steps & Code to Reproduce | ||
|
||
> Describe your current debugging efforts. | ||
#### Code Sample | ||
|
||
```java | ||
|
||
> Your code here. Bigger samples should ideally be as separate Android Studio project, | ||
> in gists/repositories or privately at help@realm.io) | ||
|
||
``` | ||
|
||
#### Version of Realm and tooling | ||
Realm version(s): ? | ||
|
||
Android Studio version: ? | ||
|
||
Which Android version and device: ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE suppressions PUBLIC | ||
"-//Puppy Crawl//DTD Suppressions 1.1//EN" | ||
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> | ||
<suppressions> | ||
<suppress checks="[a-zA-Z0-9]*" files="R\.java" /> | ||
<suppress checks="." files="BuildConfig.java" /> | ||
<suppress checks="." files=".*\.properties" /> | ||
<suppress checks="FileLength" files="RealmTests.java" /> | ||
<suppress checks="FileLengthCheck" files="Realm.java|RealmAsyncQueryTests.java|RealmQuery.java|RealmQueryTests.java"/> | ||
</suppressions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE module PUBLIC | ||
"-//Puppy Crawl//DTD Check Configuration 1.2//EN" | ||
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> | ||
|
||
<module name="Checker"> | ||
<!-- There are non-ascii test cases --> | ||
<property name="charset" value="UTF-8"/> | ||
<!-- Files to ignore --> | ||
<module name="SuppressionFilter"> | ||
<property name="file" value="${proj.module.dir}/../config/checkstyle/checkstyle-suppressions.xml"/> | ||
</module> | ||
|
||
<module name="NewlineAtEndOfFile"> | ||
<property name="lineSeparator" value="lf"/> | ||
</module> | ||
<module name="FileLength"/> | ||
<module name="FileTabCharacter"/> | ||
|
||
<!-- Trailing spaces --> | ||
<!-- TODO: UNCOMMENT | ||
<module name="RegexpSingleline"> | ||
<property name="format" value="\s+$"/> | ||
<property name="message" value="Line has trailing spaces."/> | ||
</module> --> | ||
|
||
<!-- Space after 'for', 'if', 'while', 'try' --> | ||
<module name="RegexpSingleline"> | ||
<property name="format" value="^\s*(for|if|while|try)[^ ]"/> | ||
<property name="message" value="Space needed before opening parenthesis."/> | ||
</module> | ||
|
||
<!-- For each spacing --> | ||
<module name="RegexpSingleline"> | ||
<property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/> | ||
<property name="message" value="Space needed around ':' character."/> | ||
</module> | ||
|
||
<module name="TreeWalker"> | ||
<property name="cacheFile" value="bin/cachefile"/> | ||
|
||
<!-- Checks for Javadoc comments. --> | ||
<!-- See http://checkstyle.sf.net/config_javadoc.html --> | ||
<!--module name="JavadocMethod"/--> | ||
<!--module name="JavadocType"/--> | ||
<!--module name="JavadocVariable"/--> | ||
<!-- TODO: UNCOMMENT | ||
<module name="JavadocStyle"/> --> | ||
|
||
|
||
<!-- Checks for Naming Conventions. --> | ||
<!-- See http://checkstyle.sf.net/config_naming.html --> | ||
<!-- TODO: UNCOMMENT | ||
<module name="ConstantName"/> | ||
<module name="LocalFinalVariableName"/> | ||
<module name="LocalVariableName"/> | ||
<module name="MemberName"/> | ||
<module name="MethodName"/> | ||
<module name="PackageName"/> | ||
<module name="ParameterName"/> | ||
<module name="StaticVariableName"/> | ||
<module name="TypeName"/> --> | ||
|
||
|
||
<!-- Checks for imports --> | ||
<!-- See http://checkstyle.sf.net/config_import.html --> | ||
<!--<module name="AvoidStarImport"/>--> | ||
<!--<module name="IllegalImport"/>--> <!-- defaults to sun.* packages --> | ||
<!--<module name="RedundantImport"/>--> | ||
<!--<module name="UnusedImports"/>--> | ||
|
||
|
||
<!-- Checks for Size Violations. --> | ||
<!-- See http://checkstyle.sf.net/config_sizes.html --> | ||
<!-- TODO: UNCOMMENT | ||
<module name="LineLength"> | ||
<property name="max" value="120"/> | ||
<property name="severity" value="warning"/> | ||
</module> --> | ||
<!--<module name="MethodLength"/>--> | ||
<!--<module name="ParameterNumber"/>--> | ||
|
||
|
||
<!-- Checks for whitespace --> | ||
<!-- See http://checkstyle.sf.net/config_whitespace.html --> | ||
<!-- TODO: UNCOMMENT | ||
<module name="GenericWhitespace"/> | ||
<module name="EmptyForIteratorPad"/> | ||
<module name="MethodParamPad"/> | ||
<module name="NoWhitespaceAfter"/> | ||
<module name="NoWhitespaceBefore"/> | ||
<module name="OperatorWrap"/> | ||
<module name="ParenPad"/> | ||
<module name="TypecastParenPad"/> | ||
<module name="WhitespaceAfter"/> --> | ||
<module name="WhitespaceAround"> | ||
<property name="tokens" value="LITERAL_DO"/> | ||
</module> | ||
|
||
|
||
<!-- Modifier Checks --> | ||
<!-- See http://checkstyle.sf.net/config_modifiers.html --> | ||
<!-- TODO: UNCOMMENT | ||
<module name="ModifierOrder"/> | ||
<module name="RedundantModifier"/> --> | ||
|
||
|
||
<!-- Checks for blocks. You know, those {}'s --> | ||
<!-- See http://checkstyle.sf.net/config_blocks.html --> | ||
<!-- <module name="AvoidNestedBlocks"/> --> | ||
<!--module name="EmptyBlock"/--> | ||
<!-- <module name="LeftCurly"/> --> | ||
<!--module name="NeedBraces"/--> | ||
<!-- <module name="RightCurly"/> --> | ||
|
||
|
||
<!-- Checks for common coding problems --> | ||
<!-- See http://checkstyle.sf.net/config_coding.html --> | ||
<!--module name="AvoidInlineConditionals"/--> | ||
<!-- TODO: UNCOMMENT | ||
<module name="CovariantEquals"/> | ||
<module name="EmptyStatement"/> | ||
<module name="EqualsAvoidNull"/> | ||
<module name="EqualsHashCode"/> | ||
<module name="HiddenField"/> | ||
<module name="IllegalInstantiation"/> | ||
<module name="InnerAssignment"/> | ||
<module name="MagicNumber"> | ||
<property name="severity" value="warning"/> | ||
</module> | ||
<module name="MissingSwitchDefault"/> | ||
<module name="SimplifyBooleanExpression"/> | ||
<module name="SimplifyBooleanReturn"/> --> | ||
|
||
<!-- Checks for class design --> | ||
<!-- See http://checkstyle.sf.net/config_design.html --> | ||
<!--module name="DesignForExtension"/--> | ||
<!-- TODO: UNCOMMENT | ||
<module name="FinalClass"> | ||
<property name="severity" value="warning"/> | ||
</module> | ||
<module name="HideUtilityClassConstructor"/> | ||
<module name="InterfaceIsType"/> --> | ||
<!--module name="VisibilityModifier"/--> | ||
|
||
|
||
<!-- Miscellaneous other checks. --> | ||
<!-- See http://checkstyle.sf.net/config_misc.html --> | ||
<!-- TODO: UNCOMMENT <module name="ArrayTypeStyle"/> --> | ||
<!--module name="FinalParameters"/--> | ||
<!--module name="TodoComment"/--> | ||
<!-- TODO: UNCOMMENT <module name="UpperEll"/> --> | ||
</module> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<FindBugsFilter> | ||
<Match> | ||
<!-- ignore all issues in resource generation --> | ||
<Class name="~.*\.R\$.*"/> | ||
</Match> | ||
<Match> | ||
<Class name="~.*\.Manifest\$.*"/> | ||
</Match> | ||
<Match> | ||
<Class name="io.realm.RealmBaseAdapter" /> | ||
<Field name="context" /> | ||
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" /> | ||
</Match> | ||
<Match> | ||
<Class name="io.realm.RealmBaseAdapter" /> | ||
<Field name="inflater" /> | ||
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" /> | ||
</Match> | ||
|
||
<!-- Unit tests --> | ||
<Match> | ||
<Class name="~.*Tests?$"/> | ||
<Bug pattern="DM_GC"/> | ||
</Match> | ||
|
||
</FindBugsFilter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="RealmRuleset" | ||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> | ||
|
||
<description> | ||
Realm PMD ruleset | ||
</description> | ||
|
||
<rule ref="rulesets/java/basic.xml"> | ||
<exclude name="UselessParentheses"/> | ||
</rule> | ||
|
||
<rule ref="rulesets/java/android.xml"/> | ||
|
||
</ruleset> |