Skip to content

Commit 3705880

Browse files
Implement Mihon's spotless PR (#1257)
* Remove detekt (mihonapp/mihon#1130) Annoying. More annoying in this project. (cherry picked from commit 777ae24) * Add spotless (with ktlint) (mihonapp/mihon#1136) (cherry picked from commit 5ae8095) * Address spotless lint errors (mihonapp/mihon#1138) * Add spotless (with ktlint) * Run spotlessApply * screaming case screaming case screaming case * Update PagerViewerAdapter.kt * Update ReaderTransitionView.kt (cherry picked from commit d6252ab) * Generate locales_config.xml in build dir (cherry picked from commit ac41bff) * Address more spotless lint errors in SY * some more missed * more missed * still missing, not sure while it won't report error when running locally * one more * more * more * correct comment --------- Co-authored-by: AntsyLich <[email protected]>
1 parent 759fd4d commit 3705880

File tree

363 files changed

+1224
-3139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+1224
-3139
lines changed

.github/workflows/build_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: gradle/actions/setup-gradle@v4
3737

3838
- name: Build app
39-
run: ./gradlew detekt assembleDevDebug
39+
run: ./gradlew spotlessCheck assembleDevDebug
4040

4141
- name: Upload APK
4242
uses: actions/upload-artifact@v4

.github/workflows/build_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
# SY -->
5151

5252
- name: Build app and run unit tests
53-
run: ./gradlew detekt assembleStandardRelease testStandardReleaseUnitTest --stacktrace
53+
run: ./gradlew spotlessCheck assembleStandardRelease testStandardReleaseUnitTest --stacktrace
5454

5555
- name: Sign APK
5656
uses: r0adkll/sign-android-release@v1

CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ Before you start, please note that the ability to use following technologies is
2424
- [Android Studio](https://developer.android.com/studio)
2525
- Emulator or phone with developer options enabled to test changes.
2626

27-
## Linting
28-
29-
Run the `detekt` gradle task. If the build fails, a report of issues can be found in `app/build/reports/detekt/`. The report is availble in several formats and details each issue that needs attention.
30-
3127
## Getting help
3228

3329
- Join [the Discord server](https://discord.gg/tachiyomi) for online help and to ask questions while developing.

app/build.gradle.kts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
2121

2222
// shortcutHelper.setFilePath("./shortcuts.xml")
2323

24-
val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
24+
val supportedAbis = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
2525

2626
android {
2727
namespace = "eu.kanade.tachiyomi"
@@ -38,7 +38,7 @@ android {
3838
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
3939

4040
ndk {
41-
abiFilters += SUPPORTED_ABIS
41+
abiFilters += supportedAbis
4242
}
4343
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4444
}
@@ -47,7 +47,7 @@ android {
4747
abi {
4848
isEnable = true
4949
reset()
50-
include(*SUPPORTED_ABIS.toTypedArray())
50+
include(*supportedAbis.toTypedArray())
5151
isUniversalApk = true
5252
}
5353
}
@@ -162,7 +162,7 @@ dependencies {
162162
implementation(compose.ui.tooling.preview)
163163
implementation(compose.ui.util)
164164
implementation(compose.accompanist.systemuicontroller)
165-
165+
166166
implementation(androidx.interpolator)
167167

168168
implementation(androidx.paging.runtime)
@@ -243,7 +243,6 @@ dependencies {
243243
implementation(libs.compose.webview)
244244
implementation(libs.compose.grid)
245245

246-
247246
// Logging
248247
implementation(libs.logcat)
249248

app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
<background android:drawable="@color/ic_launcher_background"/>
44
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
55
<monochrome android:drawable="@drawable/ic_tachi_monochrome_launcher" />
6-
</adaptive-icon>
6+
</adaptive-icon>

app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
<background android:drawable="@color/ic_launcher_background"/>
44
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
55
<monochrome android:drawable="@drawable/ic_tachi_monochrome_launcher" />
6-
</adaptive-icon>
6+
</adaptive-icon>

app/src/main/java/eu/kanade/domain/source/interactor/GetEnabledSources.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ class GetEnabledSources(
3232
) { a, b, c -> Triple(a, b, c) },
3333
// SY <--
3434
repository.getSources(),
35-
) { pinnedSourceIds,
36-
(enabledLanguages, disabledSources, lastUsedSource),
37-
(excludedFromDataSaver, sourcesInCategories, sourceCategoriesFilter),
38-
sources,
35+
) {
36+
pinnedSourceIds,
37+
(enabledLanguages, disabledSources, lastUsedSource),
38+
(excludedFromDataSaver, sourcesInCategories, sourceCategoriesFilter),
39+
sources,
3940
->
4041

4142
val sourcesAndCategories = sourcesInCategories.map {

app/src/main/java/eu/kanade/domain/sync/SyncPreferences.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SyncPreferences(
1313
fun clientAPIKey() = preferenceStore.getString("sync_client_api_key", "")
1414
fun lastSyncTimestamp() = preferenceStore.getLong(Preference.appStateKey("last_sync_timestamp"), 0L)
1515

16-
fun lastSyncEtag() = preferenceStore.getString("sync_etag", "")
16+
fun lastSyncEtag() = preferenceStore.getString("sync_etag", "")
1717

1818
fun syncInterval() = preferenceStore.getInt("sync_interval", 0)
1919
fun syncService() = preferenceStore.getInt("sync_service", 0)

app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@ class UiPreferences(
1818

1919
fun themeMode() = preferenceStore.getEnum(
2020
"pref_theme_mode_key",
21-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ThemeMode.SYSTEM } else { ThemeMode.LIGHT },
21+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
22+
ThemeMode.SYSTEM
23+
} else {
24+
ThemeMode.LIGHT
25+
},
2226
)
2327

2428
fun appTheme() = preferenceStore.getEnum(
2529
"pref_app_theme",
26-
if (DeviceUtil.isDynamicColorAvailable) { AppTheme.MONET } else { AppTheme.DEFAULT },
30+
if (DeviceUtil.isDynamicColorAvailable) {
31+
AppTheme.MONET
32+
} else {
33+
AppTheme.DEFAULT
34+
},
2735
)
2836

2937
fun themeDarkAmoled() = preferenceStore.getBoolean("pref_theme_dark_amoled_key", false)

app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private fun DetailsHeader(
240240
Extension name: ${extension.name} (lang: ${extension.lang}; package: ${extension.pkgName})
241241
Extension version: ${extension.versionName} (lib: ${extension.libVersion}; version code: ${extension.versionCode})
242242
NSFW: ${extension.isNsfw}
243-
""".trimIndent()
243+
""".trimIndent(),
244244
)
245245

246246
if (extension is Extension.Installed) {
@@ -250,8 +250,8 @@ private fun DetailsHeader(
250250
Update available: ${extension.hasUpdate}
251251
Obsolete: ${extension.isObsolete}
252252
Shared: ${extension.isShared}
253-
Repository: ${extension.repoUrl}
254-
""".trimIndent()
253+
Repository: ${extension.repoUrl}
254+
""".trimIndent(),
255255
)
256256
}
257257
}

0 commit comments

Comments
 (0)