Skip to content

Commit

Permalink
Add detekt and ktlint to view options app
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohsen Mirhoseini committed Nov 10, 2022
1 parent f45afed commit 53b2233
Show file tree
Hide file tree
Showing 19 changed files with 222 additions and 52 deletions.
25 changes: 25 additions & 0 deletions view_options/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SOURCE: https://github.com/JetBrains/kotlin-playground/blob/master/.editorconfig
root = true


[*]
indent_style = space
indent_size = 4

max_line_length = 150

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

ij_continuation_indent_size = 4
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_spaces_around_equality_operators = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
10 changes: 6 additions & 4 deletions view_options/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ output.json

# IntelliJ
*.iml
.idea/
.idea/*
!.idea/codeStyles/
!.idea/detekt.xml
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml

# Keystore files
*.jks
*.keystore
# *.jks
# *.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json
# google-services.json

# Android Profiling
*.hprof
Expand Down
140 changes: 140 additions & 0 deletions view_options/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions view_options/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions view_options/.idea/detekt.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions view_options/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jlleitschuh.gradle.ktlint")
id("io.gitlab.arturbosch.detekt")
}

android {
Expand Down Expand Up @@ -34,14 +36,28 @@ android {
}

kotlinOptions {
allWarningsAsErrors = true
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

lint {
abortOnError = true
ignoreWarnings = false
warningsAsErrors = true
}

buildFeatures {
viewBinding = true
}
}

detekt {
allRules = true
config = files("$rootDir/config/detekt/detekt-config.yml")
baseline = file("detekt-baseline.xml")
buildUponDefaultConfig = true
}

dependencies {
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
Expand Down
11 changes: 1 addition & 10 deletions view_options/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

<application
android:name=".ExampleApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand All @@ -18,15 +15,9 @@
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<!-- this is required by Firework Android SDK v2 to get advertising_id from Android Ad SDK -->
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true" />
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class MainActivity : AppCompatActivity() {
videoFeedView.init(viewOptions)
}


private fun setupVideoFeedViewCallbacks() {

// All errors related to this video feed view can be collected using this callback to handle
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

2 changes: 1 addition & 1 deletion view_options/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Firework View Options Example</string>
<string name="app_name">FW View Options</string>
</resources>
13 changes: 0 additions & 13 deletions view_options/app/src/main/res/xml/backup_rules.xml

This file was deleted.

19 changes: 0 additions & 19 deletions view_options/app/src/main/res/xml/data_extraction_rules.xml

This file was deleted.

2 changes: 2 additions & 0 deletions view_options/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id("com.android.application") version "7.3.1" apply false
id("com.android.library") version "7.3.1" apply false
id("org.jetbrains.kotlin.android") version "1.6.10" apply false
id("org.jlleitschuh.gradle.ktlint") version "10.3.0" apply false
id("io.gitlab.arturbosch.detekt") version "1.20.0" apply false
}

task<Delete>("clean") {
Expand Down
13 changes: 13 additions & 0 deletions view_options/config/detekt/detekt-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
style:
MaxLineLength:
maxLineLength: 150

ReturnCount:
max: 5

complexity:
LongParameterList:
constructorThreshold: 15

TooManyFunctions:
ignorePrivate: true

0 comments on commit 53b2233

Please sign in to comment.