Skip to content

Commit

Permalink
ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
ahudson20 committed May 6, 2024
1 parent 32a1fc3 commit 30d18ed
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 63 deletions.
6 changes: 4 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[*.{kt,kts}]
insert_final_newline = true
max_line_length = off
ktlint_standard_indent = disabled
ktlint_standard_argument-list-wrapping = disabled
ktlint_standard_parameter-list-wrapping = disabled
Expand All @@ -8,5 +10,5 @@ ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_standard_max-line-length = disabled
ktlint_standard_import-ordering = disabled
ktlint_disabled_rules = import-ordering
max_line_length = off
ktlint_standard_final-newline = enabled
ktlint_disabled_rules = import-ordering
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class AndroidApplicationComposePlugin : Plugin<Project> {
configureAndroidCompose(extension)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class AndroidApplicationPlugin : Plugin<Project> {
}
}
}
}
}
1 change: 1 addition & 0 deletions build-logic/structure/src/main/kotlin/AndroidHiltPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ class AndroidHiltPlugin : Plugin<Project> {
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class AndroidHiltWorkerPlugin : Plugin<Project> {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class AndroidLibraryComposePlugin : Plugin<Project> {
configureAndroidCompose(extension)
}
}
}
}
5 changes: 3 additions & 2 deletions build-logic/structure/src/main/kotlin/AndroidLibraryPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ class AndroidLibraryPlugin : Plugin<Project> {
}
extensions.configure<LibraryAndroidComponentsExtension> {
beforeVariants {
it.enableAndroidTest = it.enableAndroidTest
&& project.projectDir.resolve("src/androidTest").exists()
it.enableAndroidTest = it.enableAndroidTest &&
project.projectDir.resolve("src/androidTest").exists()
}
}
}
}
}

2 changes: 1 addition & 1 deletion build-logic/structure/src/main/kotlin/AndroidLintPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ class AndroidLintPlugin : Plugin<Project> {
}
}
}
}
}
2 changes: 1 addition & 1 deletion build-logic/structure/src/main/kotlin/AndroidRoomPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ class AndroidRoomPlugin : Plugin<Project> {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ object DefaultConfig {
const val compileSdk = 34
const val versionCode = 1
const val versionName = "1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Taken from NIA sample app by Google

internal fun Project.configureKotlinAndroid(
commonExtension: CommonExtension<*, *, *, *, *>,
commonExtension: CommonExtension<*, *, *, *, *>
) {
commonExtension.apply {
compileSdk = DefaultConfig.compileSdk
Expand Down Expand Up @@ -54,7 +54,7 @@ private fun Project.configureKotlin() {
}

internal fun Project.configureAndroidCompose(
commonExtension: CommonExtension<*, *, *, *, *>,
commonExtension: CommonExtension<*, *, *, *, *>
) {
commonExtension.apply {
buildFeatures {
Expand All @@ -73,4 +73,4 @@ internal fun Project.configureAndroidCompose(
add("debugImplementation", libs.findLibrary("androidx-compose-ui-tooling").get())
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fun DependencyHandlerScope.modules(vararg module: String) {
modules.forEach {
add("implementation", project(it))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ fun VersionCatalog.getLibrary(alias: String): Provider<MinimalExternalModuleDepe
findLibrary(alias).get()

fun VersionCatalog.getPlugin(alias: String): Provider<PluginDependency> =
findPlugin(alias).get()
findPlugin(alias).get()
24 changes: 0 additions & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,3 @@ plugins {
alias(libs.plugins.hilt) apply false
alias(libs.plugins.ktlint) apply false
}

allprojects {
tasks.register("copyGitHooks", Copy::class) {
description = "Copies the git hooks from /git-hooks to the .git folder."
group = "git hooks"
from("$rootDir/scripts/pre-commit")
into("$rootDir/.git/hooks/")
// fileMode = 0b111101101
}

tasks.register("installGitHooks", Exec::class) {
description = "Installs the pre-commit git hooks from /git-hooks."
group = "git hooks"
workingDir = rootDir
commandLine("chmod", "-R", "+x", ".git/hooks/")
dependsOn("copyGitHooks")
doLast {
logger.info("Git hook installed successfully.")
}
}
afterEvaluate {
tasks.findByName("preBuild")?.dependsOn("installGitHooks")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.junit.runner.Description

@OptIn(ExperimentalCoroutinesApi::class)
class MainDispatcherRule(
private val testDispatcher: TestDispatcher = UnconfinedTestDispatcher(),
private val testDispatcher: TestDispatcher = UnconfinedTestDispatcher()
) : TestWatcher() {
override fun starting(description: Description) {
Dispatchers.setMain(testDispatcher)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Qualifier
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import javax.inject.Qualifier

@Retention(AnnotationRetention.RUNTIME)
@Qualifier
Expand Down
21 changes: 0 additions & 21 deletions scripts/pre-commit

This file was deleted.

0 comments on commit 30d18ed

Please sign in to comment.