Skip to content

Commit

Permalink
Merge pull request #29 from KevinSchildhorn/ktFormat2
Browse files Browse the repository at this point in the history
moreformatting
  • Loading branch information
KevinSchildhorn authored Dec 4, 2023
2 parents 9d6bcef + e4888c1 commit d4f488c
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 57 deletions.
39 changes: 10 additions & 29 deletions .github/workflows/lint-action.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.typography
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms.compose
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms.compose
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.atomik.atomic.atoms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion shared/src/androidMain/kotlin/Main.android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 7 in shared/src/androidMain/kotlin/Main.android.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/androidMain/kotlin/Main.android.kt#L7 <standard:function-naming>

Function name should start with a lowercase letter (except factory methods) and use camel case
Raw output
shared/src/androidMain/kotlin/Main.android.kt:7:5: error: Function name should start with a lowercase letter (except factory methods) and use camel case (standard:function-naming)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class LoginCredentials(
val isComplete: Boolean
get() =
hostname.isNotBlank() &&
username.isNotBlank() &&
password.isNotBlank() &&
sharedFolder.isNotBlank()
username.isNotBlank() &&

Check failure on line 16 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt#L16 <standard:indent>

Unexpected indentation (20) (should be 16)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt:16:1: error: Unexpected indentation (20) (should be 16) (standard:indent)
password.isNotBlank() &&

Check failure on line 17 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt#L17 <standard:indent>

Unexpected indentation (20) (should be 16)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt:17:1: error: Unexpected indentation (20) (should be 16) (standard:indent)
sharedFolder.isNotBlank()

Check failure on line 18 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt#L18 <standard:indent>

Unexpected indentation (20) (should be 16)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt:18:1: error: Unexpected indentation (20) (should be 16) (standard:indent)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check failure on line 36 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt#L36 <standard:indent>

Unexpected indentation (12) (should be 16)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt:36:1: error: Unexpected indentation (12) (should be 16) (standard:indent)
top = Padding.SMALL.dp,
start = Padding.STANDARD.dp,
bottom = Padding.LARGE.dp,
),

Check failure on line 40 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt#L40 <standard:indent>

Unexpected indentation (12) (should be 16)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt:40:1: error: Unexpected indentation (12) (should be 16) (standard:indent)
)
LoginScreenForm(
uiState = uiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ fun ErrorView(
}
Box(
modifier =
configuredModifier.padding(
horizontal = atom.paddingHorizontal?.dp ?: 0.dp,
vertical = atom.paddingVertical?.dp ?: 0.dp,
),
configuredModifier.padding(

Check failure on line 27 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt#L27 <standard:indent>

Unexpected indentation (8) (should be 12)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt:27:1: error: Unexpected indentation (8) (should be 12) (standard:indent)
horizontal = atom.paddingHorizontal?.dp ?: 0.dp,
vertical = atom.paddingVertical?.dp ?: 0.dp,

Check failure on line 29 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt#L29 <standard:indent>

Unexpected indentation (12) (should be 16)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt:29:1: error: Unexpected indentation (12) (should be 16) (standard:indent)
),

Check failure on line 30 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt#L30 <standard:indent>

Unexpected indentation (8) (should be 12)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt:30:1: error: Unexpected indentation (8) (should be 12) (standard:indent)
) {
Text(
text = message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check failure on line 29 in shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt

View workflow job for this annotation

GitHub Actions / ktlint

[ktlint] shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt#L29 <standard:indent>

Unexpected indentation (8) (should be 12)
Raw output
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt:29:1: error: Unexpected indentation (8) (should be 12) (standard:indent)
backgroundColor = molecule.color.composeColor,
disabledBackgroundColor = molecule.disabledColor.composeColor,
),
) {
if (buttonState.loading) {
CircularProgressIndicator(
Expand Down

0 comments on commit d4f488c

Please sign in to comment.