Skip to content

Instantly share code, notes, and snippets.

@alpargabos
alpargabos / checkstyle.xml
Created August 14, 2016 17:26
Checkstyle-checkstyle.xml
<?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 is a checkstyle configuration file. For descriptions of
what the following rules do, please see the checkstyle configuration
page at http://checkstyle.sourceforge.net/config.html -->
<module name="Checker">
@alpargabos
alpargabos / supressions.xml
Created August 14, 2016 17:28
Checkstyle-supressions.xml
<?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 files="R.java" checks="[a-zA-Z0-9]*"/>
<suppress files="BuildConfig.java" checks="[a-zA-Z0-9]*"/>
<!-- <suppress files="Test" checks="[a-zA-Z0-9]*"/> -->
@alpargabos
alpargabos / build.gradle
Created August 14, 2016 17:30
Checkstyle-gradle
apply plugin: 'checkstyle'
// Add checkstyle to the check task.
check.dependsOn 'checkstyle'
task checkstyle(type: Checkstyle) {
configFile file("../config/quality/checkstyle/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("../config/quality/checkstyle/suppressions.xml").absolutePath
source 'src'
include '**/*.java'
@alpargabos
alpargabos / pmd.gradle
Created August 14, 2016 19:02
pmd gradle task
apply plugin: 'pmd'
// Add pmd
check.dependsOn 'pmd'
task pmd(type: Pmd) {
ignoreFailures = false
ruleSetFiles = files("../config/quality/pmd/pmd-ruleset.xml")
source 'src'
@alpargabos
alpargabos / pmd-ruleset.xml
Created August 14, 2016 19:05
pmd ruleset
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Android Application Rules"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Custom ruleset for Android application</description>
<exclude-pattern>.*/R.java</exclude-pattern>
<exclude-pattern>.*/gen/.*</exclude-pattern>
apply plugin: 'findbugs'
dependencies {
findbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.4.2'
}
// Add findbugs to the check task.
check.dependsOn 'findbugs'
task findbugs(type: FindBugs, dependsOn: assembleDebug ) {
@alpargabos
alpargabos / indbugs-filter.xml
Created August 24, 2016 10:50
gradle findbugs exclude filter
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<!-- http://stackoverflow.com/questions/7568579/eclipsefindbugs-exclude-filter-files-doesnt-work -->
<Match>
<Class name="~.*\.R\$.*"/>
</Match>
<Match>
<Class name="~.*\.Manifest\$.*"/>
</Match>