Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Added nlopez compose rules for ktlint and detekt #242

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ android {
}

dependencies {
detektPlugins("io.nlopez.compose.rules:detekt:0.4.17")
lintChecks("com.slack.lint.compose:compose-lint-checks:1.4.2")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.activity:activity-ktx:1.9.2")
implementation("androidx.navigation:navigation-fragment-ktx:2.8.0")
Expand Down
19 changes: 0 additions & 19 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,6 @@
</intent-filter>
</activity>

<activity
android:name=".activities.SplashActivity"
android:exported="false"
/>

<activity-alias
android:name=".activities.SplashActivity.Orange"
android:enabled="true"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:targetActivity=".activities.SplashActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity
android:name=".fragments.MainFragment"
android:exported="false" />
Expand Down
22 changes: 2 additions & 20 deletions app/src/main/java/be/scri/ui/screens/ThirdPartyScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import be.scri.R
import be.scri.ui.theme.ScribeTheme
import be.scri.ui.theme.ScribeTypography

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
fun ThirdPartyScreen() {
Scaffold(modifier = Modifier.fillMaxSize()) {
fun ThirdPartyScreen(modifier: Modifier = Modifier) {
Scaffold(modifier = modifier.fillMaxSize()) {
Column(
modifier =
Modifier
Expand Down Expand Up @@ -68,19 +66,3 @@ fun ThirdPartyScreen() {
}
}
}

@Preview
@Composable
fun ThirdPartyScreenPreviewDark() {
ScribeTheme(useDarkTheme = true) {
ThirdPartyScreen()
}
}

@Preview
@Composable
fun ThirdPartyScreenPreviewLight() {
ScribeTheme(useDarkTheme = false) {
ThirdPartyScreen()
}
}
10 changes: 0 additions & 10 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,6 @@
<item name="android:backgroundDimEnabled">false</item>
</style>

<style name="PinNumberStyle.Base">
<item name="android:gravity">center</item>
<item name="android:padding">@dimen/small_margin</item>
<item name="android:textSize">@dimen/big_text_size</item>
</style>

<style name="PinNumberStyle" parent="PinNumberStyle.Base">
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
</style>

<style name="ColoredButtonStyle" parent="@android:style/Widget.TextView">
<item name="android:textFontWeight">600</item>
<item name="android:textAllCaps">true</item>
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildscript {
}

dependencies {
classpath("io.nlopez.compose.rules:ktlint:0.4.17")
classpath("com.android.tools.build:gradle:8.6.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.6")
Expand Down
2 changes: 1 addition & 1 deletion detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ style:
naming:
FunctionNaming:
active: true
ignoreAnnotated: ['Composable']
ignoreAnnotated: ["Composable"]

complexity:
TooManyFunctions:
Expand Down
15 changes: 15 additions & 0 deletions lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="FrequentlyChangedStateReadInComposition" severity="error" />
<issue id="ComposableModifierFactory" severity="error" />
<issue id="ModifierFactoryExtensionFunction" severity="error" />
<issue id="ModifierFactoryReturnType" severity="error" />
<issue id="ModifierParameter" severity="error" />
<issue id="UnnecessaryComposedModifier" severity="error" />
<issue id="InvalidColorHexValue" severity="error" />
<issue id="MissingColorAlphaChannel" severity="error" />
<issue id="ComposableLambdaParameterNaming" severity="error" />
<issue id="ComposableNaming" severity="error" />
<issue id="CompositionLocalNaming" severity="error" />
<issue id="MutableCollectionMutableState" severity="error" />
</lint>
Loading