Skip to content

Commit

Permalink
Replacing Spotless with Ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidGarousi committed Jan 27, 2023
1 parent 6ac906c commit d5f0696
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: ./gradlew assemble

- name: Static Analysis
run: ./gradlew spotlessCheck detekt
run: ./gradlew ktlintCheck detekt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("LongParameterList","TooManyFunctions")
@file:Suppress("LongParameterList", "TooManyFunctions")

package dev.garousi.stockwatcher.feature.watchlist.data

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@file:Suppress("UnusedPrivateMember")
package dev.garousi.stockwatcher.feature.watchlist.data

enum class SubscriptionMode(mode: String) {
Merge("MERGE"),
Command("COMMAND"),
enum class SubscriptionMode {
Merge,
Command,
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun StockList(
) {
itemsIndexed(
items = stocks,
key = { index, item -> item.itemName },
key = { _, item -> item.itemName },
) { index, stock ->
StockItem(
stock = stock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import androidx.compose.material.primarySurface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment.Companion.Center
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("MagicNumber","ForEachOnRange")
@file:Suppress("MagicNumber", "ForEachOnRange")
package dev.garousi.stockwatcher.feature.watchlist.presentation

import dev.garousi.stockwatcher.feature.watchlist.domain.models.Stock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ fun StockWatcherApp(
testTagsAsResourceId = true
},
bottomBar = {

},
) { padding ->
Row(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("MagicNumber","FunctionNaming")
@file:Suppress("MagicNumber", "FunctionNaming")
package dev.garousi.stockwatcher.ui.theme

import androidx.compose.foundation.isSystemInDarkTheme
Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ plugins {
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'com.google.dagger.hilt.android' version '2.44.2' apply false
id "com.github.ben-manes.versions" version "0.44.0"
id "com.diffplug.spotless" version "6.12.1"
// id "com.diffplug.spotless" version "6.12.1"
id "io.gitlab.arturbosch.detekt" version "1.22.0"
id "org.jlleitschuh.gradle.ktlint" version "10.2.0"
}

subprojects {
apply from: "../buildscripts/versionsplugin.gradle"
apply from: "../buildscripts/spotless.gradle"
apply from: "../buildscripts/ktlint.gradle"
apply from: "../buildscripts/detekt.gradle"
apply from: "../buildscripts/versionsplugin.gradle"
}
14 changes: 14 additions & 0 deletions buildscripts/ktlint.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apply plugin: "org.jlleitschuh.gradle.ktlint"

ktlint {
// https://github.com/pinterest/ktlint/releases
version = "0.45.2"

reporters {
reporter "plain"
reporter "checkstyle"
reporter "html"
}

outputColorName = "RED"
}

0 comments on commit d5f0696

Please sign in to comment.