Introduce codenarc to keep this groovy tidy

This commit is contained in:
R. Tyler Croy 2015-07-26 22:41:25 -07:00
parent 28756c36c4
commit 072210343f
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
5 changed files with 29 additions and 6 deletions

View File

@ -15,6 +15,7 @@ buildscript {
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.ysb33r.gradletest'
apply plugin: 'codenarc'
apply plugin: 'groovy'
apply plugin: 'maven'
@ -42,6 +43,11 @@ dependencies {
}
}
codenarc {
sourceSets = [sourceSets.main]
configFile = file('gradle/codenarc.xml')
}
test {
testLogging {
showStandardStreams = true

23
gradle/codenarc.xml Normal file
View File

@ -0,0 +1,23 @@
<ruleset xmlns="http://codenarc.org/ruleset/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codenarc.org/ruleset/1.0 http://codenarc.org/ruleset-schema.xsd"
xsi:noNamespaceSchemaLocation="http://codenarc.org/ruleset-schema.xsd">
<description>Sample rule set</description>
<ruleset-ref path='rulesets/imports.xml'>
<rule-config name='DuplicateImport'>
<property name='priority' value='1'/>
</rule-config>
</ruleset-ref>
<ruleset-ref path='rulesets/basic.xml'>
<exclude name='StringInstantiation'/>
</ruleset-ref>
<rule class='org.codenarc.rule.generic.IllegalRegexRule'>
<property name="name" value="AuthorTagNotAllowed"/>
<property name='regex' value='\@author'/>
</rule>
</ruleset>

View File

@ -3,7 +3,6 @@ package com.github.jrubygradle.storm
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
/**
* @author R. Tyler Croy
*/
class JRubyStorm extends ShadowJar {
}

View File

@ -6,7 +6,6 @@ import org.gradle.api.Project
/**
* @author R. Tyler Croy
*/
class JRubyStormLocal extends JavaExec {

View File

@ -6,14 +6,10 @@ import groovy.transform.PackageScope
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.testing.Test
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
/**
* @author R. Tyler Croy
*/
class JRubyStormPlugin implements Plugin<Project> {
void apply(Project project) {