Skip to content

Commit

Permalink
fix lint issues and run static analysis for all modules
Browse files Browse the repository at this point in the history
  • Loading branch information
tasomaniac committed Oct 25, 2019
1 parent 320b0dc commit 480cf4f
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 46 deletions.
36 changes: 0 additions & 36 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ apply plugin: 'com.android.application'
apply from: configFile('android-common-config.gradle')
apply plugin: 'com.novoda.android-command'
apply plugin: 'com.novoda.build-properties'
apply plugin: 'com.novoda.static-analysis'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'org.jlleitschuh.gradle.ktlint'

buildProperties {
signing.using(configFile('release.signing')) | configFile('debug.signing')
Expand Down Expand Up @@ -60,39 +57,6 @@ android {
}
}

staticAnalysis {
penalty {
maxWarnings = 10
maxErrors = 0
}

detekt {
config = files(configFile('detekt.yml'))
}

ktlint {
reporters {
reporter "checkstyle"
}

includeVariants { it.name == 'flossDebug' }
}

lintOptions {
textReport true
textOutput 'stdout'

checkAllWarnings true
checkReleaseBuilds false

if (System.env.TRAVIS_BRANCH != 'master') ignore 'MissingTranslation'

lintConfig configFile('lint.xml')

includeVariants { it.name == 'flossDebug' }
}
}

if (isPlay) {
apply from: configFile('fabric.gradle')
apply from: configFile('play-publish.gradle')
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="error_color">#FFDD2C00</color>

<color name="feature_switch_background">#EEE</color>
</resources>
Binary file added art/web_hi_res_512_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.tasomaniac.openwith.extensions
import android.content.res.Resources
import android.util.TypedValue


fun Resources.dpToPx(dp: Int): Int {
return TypedValue
.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp.toFloat(), displayMetrics).toInt()
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions base/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
<color name="theme_primary">#3F51B5</color>
<color name="theme_primary_dark">#303F9F</color>
<color name="theme_accent">#009688</color>

<color name="window_background">@color/material_grey_50</color>
<color name="feature_switch_background">#EEE</color>
</resources>
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ allprojects {
google()
mavenCentral()
}

if (project.name != 'test-support') {
apply from: configFile('static-analysis.gradle')
}
}

apply plugin: 'com.github.ben-manes.versions'
Expand Down
2 changes: 0 additions & 2 deletions gradle/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
</issue>
<issue id="TypographyEllipsis" severity="error" />
<issue id="SimpleDateFormat" severity="error" />
<issue id="ThrowableNotAtBeginning" severity="error" />
<issue id="BinaryOperationInTimber" severity="error" />
<issue id="WifiManagerPotentialLeak" severity="error" />

<issue id="ObsoleteLintCustomCheck"
Expand Down
40 changes: 40 additions & 0 deletions gradle/static-analysis.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'org.jlleitschuh.gradle.ktlint'
apply plugin: 'com.novoda.static-analysis'


staticAnalysis {
penalty {
maxWarnings = 10
maxErrors = 0
}

detekt {
config = files(configFile('detekt.yml'))
}

ktlint {
disabledRules = ['import-ordering']
reporters {
reporter 'checkstyle'
}

includeVariants { it.name in ['flossDebug', 'debug'] }
}

lintOptions {
textReport true
textOutput 'stdout'

checkAllWarnings true
checkTestSources false
checkReleaseBuilds false
checkDependencies false

if (System.env.TRAVIS_BRANCH != 'master') ignore 'MissingTranslation'

lintConfig configFile('lint.xml')

includeVariants { it.name in ['flossDebug', 'debug'] }
}
}
4 changes: 0 additions & 4 deletions resolver/src/main/res/values/colors.xml

This file was deleted.

0 comments on commit 480cf4f

Please sign in to comment.