diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index 31bd1d84..9c9ddbb5 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -1,35 +1,16 @@ -name: Lint Action -on: - pull_request: - paths: - - '**/*.kt' - +name: reviewdog +on: [pull_request] jobs: - build: + ktlint: + name: Check Code Quality runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-java@v2 + - name: Clone repo + uses: actions/checkout@master with: - distribution: "adopt" - java-version: "17" - - - uses: reviewdog/action-setup@v1 - - uses: touchlab-lab/ktlint-action-setup@1.0.0 + fetch-depth: 1 + - name: ktlint + uses: ScaCap/action-ktlint@master with: - ktlint_version: 0.50.0 - - - name: Run reviewdog - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - ktlint --reporter=checkstyle --relative \ - | reviewdog -f=checkstyle -name="ktlint" -reporter=github-pr-review -filter-mode=added -level=warning - - - - - - + github_token: ${{ secrets.github_token }} diff --git a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt index 48336f2f..b4c03cfb 100644 --- a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt +++ b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.xml diff --git a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt index 869e2cf6..2d830197 100644 --- a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt +++ b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.xml diff --git a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt index f8766559..ebaad42f 100644 --- a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt +++ b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.typography diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt index 474578e1..beee947a 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.compose diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt index 92124a96..60b794cc 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt index e0cfe9e0..3a7e1013 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.compose diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt index e736fff1..1fdf5825 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt index e2af884e..b7cb7ba7 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt index 1431ebfa..296a704d 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt index 5c144c65..e31ae0fe 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt @@ -46,7 +46,7 @@ public open class OutlinedTextFieldMolecule( BorderedAtom, RoundedAtom { @Composable - public fun colors(): TextFieldColors { + public override fun colors(): TextFieldColors { val textColor = textAtom.textColor.composeColor val backgroundColor = backgroundColorAtom.color.composeColor val disabledBackgroundColor = backgroundColor.copy(alpha = ContentAlpha.disabled) diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt index 45edde9e..b503224a 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt @@ -34,7 +34,7 @@ public open class TextFieldMolecule( get() = listOf() @Composable - public fun colors(): TextFieldColors { + public open fun colors(): TextFieldColors { val textColor = textAtom.textColor.composeColor val backgroundColor = backgroundColorAtom.color.composeColor val disabledBackgroundColor = backgroundColor.copy(alpha = ContentAlpha.disabled) diff --git a/shared/src/androidMain/kotlin/Main.android.kt b/shared/src/androidMain/kotlin/Main.android.kt index 02e27d54..ff5574ca 100644 --- a/shared/src/androidMain/kotlin/Main.android.kt +++ b/shared/src/androidMain/kotlin/Main.android.kt @@ -3,4 +3,5 @@ import com.kevinschildhorn.fotopresenter.ui.viewmodel.LoginViewModel actual fun getPlatformName(): String = "Android" -@Composable fun MainView(viewModel: LoginViewModel) = App(viewModel) +@Composable +fun MainView(viewModel: LoginViewModel) = App(viewModel) diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt index 1a9d4444..4e21dff6 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt @@ -13,7 +13,7 @@ data class LoginCredentials( val isComplete: Boolean get() = hostname.isNotBlank() && - username.isNotBlank() && - password.isNotBlank() && - sharedFolder.isNotBlank() + username.isNotBlank() && + password.isNotBlank() && + sharedFolder.isNotBlank() } diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt index 52141fb2..78896a9a 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt @@ -33,11 +33,11 @@ fun LoginScreen( TitleView( "Foto", modifier = - Modifier.padding( - top = Padding.SMALL.dp, - start = Padding.STANDARD.dp, - bottom = Padding.LARGE.dp, - ), + Modifier.padding( + top = Padding.SMALL.dp, + start = Padding.STANDARD.dp, + bottom = Padding.LARGE.dp, + ), ) LoginScreenForm( uiState = uiState, diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt index 65e73ae0..9bbbf39f 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt @@ -24,10 +24,10 @@ fun ErrorView( } Box( modifier = - configuredModifier.padding( - horizontal = atom.paddingHorizontal?.dp ?: 0.dp, - vertical = atom.paddingVertical?.dp ?: 0.dp, - ), + configuredModifier.padding( + horizontal = atom.paddingHorizontal?.dp ?: 0.dp, + vertical = atom.paddingVertical?.dp ?: 0.dp, + ), ) { Text( text = message, diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt index 96ff0768..6adff0cd 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt @@ -26,10 +26,10 @@ fun PrimaryButton( modifier = modifier.height(44.dp), enabled = buttonState.enabled, colors = - ButtonDefaults.buttonColors( - backgroundColor = molecule.color.composeColor, - disabledBackgroundColor = molecule.disabledColor.composeColor, - ), + ButtonDefaults.buttonColors( + backgroundColor = molecule.color.composeColor, + disabledBackgroundColor = molecule.disabledColor.composeColor, + ), ) { if (buttonState.loading) { CircularProgressIndicator(