Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Use the verify task in google-formatter instead of checkstyle #55

Merged
merged 1 commit into from
Sep 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ ext.apacheThriftVersion = '0.9.3'
ext.jerseyVersion = '2.22.2'
ext.slf4jVersion = '1.7.16'
ext.jacksonVersion = '2.7.4'
ext.checkstyleVersion = '7.1.1'

Copy link
Member

@yurishkuro yurishkuro Sep 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought checkstyle checks not just the formatting, but the actual code mistakes, like go vet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think checkstyle is that intelligent. Findbugs is more similar to go vet
From wikipedia,

The performed checks mainly limit themselves to the presentation and don't analyze content, and do not confirm the correctness or completeness of the program.

ext.junitVersion = '4.12'
ext.mockitoVersion = '2.0.2-beta'
Expand Down Expand Up @@ -42,30 +41,17 @@ subprojects {

[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'

// Set up checkstyle
apply plugin: 'checkstyle'
configurations {
checkstyleConfig
}

dependencies {
checkstyleConfig("com.puppycrawl.tools:checkstyle:${checkstyleVersion}") {
transitive = false
}
}

checkstyle {
config = resources.text.fromArchiveEntry(configurations.checkstyleConfig, 'google_checks.xml')
toolVersion = checkstyleVersion
}

repositories {
mavenCentral()
}

task listJars(description: 'Display all compile jars.') << {
configurations.compile.each { File file -> println file.name }
}

task verifyFormatting(type: com.github.sherter.googlejavaformatgradleplugin.VerifyGoogleJavaFormat) {
exclude '**/gen-java/**'
}

license {
header rootProject.file('license-template')
Expand All @@ -81,6 +67,7 @@ subprojects {
}

classes.dependsOn tasks.licenseFormat
classes.dependsOn tasks.verifyFormatting

apply from: '../gradle/publish.gradle'
}