Skip to content

Commit 3c7fbee

Browse files
committed
Configured spotless with ktlint
1 parent 42d5865 commit 3c7fbee

File tree

16 files changed

+309
-278
lines changed

16 files changed

+309
-278
lines changed

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
custom: https://www.paypal.me/svignesh93
8+
custom: https://www.paypal.me/svignesh93

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ freeline_project_description.json
6060
/keystore.properties
6161
/.idea
6262
/build
63-
/captures
63+
/captures

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

build.gradle

+26-7
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@
1616

1717
// Top-level build file where you can add configuration options common to all sub-projects/modules.
1818
buildscript {
19-
ext.kotlin_version = "1.4.30"
19+
ext.kotlin_version = "1.4.32"
2020
ext.dokka_version = "1.4.20"
2121
repositories {
2222
google()
2323
mavenCentral()
24-
jcenter()
2524
}
2625
dependencies {
2726
// NOTE: Do not place your application dependencies here; they belong
2827
// in the individual module build.gradle files
29-
classpath "com.android.tools.build:gradle:4.1.2"
28+
classpath "com.android.tools.build:gradle:4.1.3"
3029

3130
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
3231
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
@@ -35,14 +34,34 @@ buildscript {
3534
}
3635
}
3736

37+
plugins {
38+
id "com.diffplug.spotless" version "5.11.1"
39+
}
40+
3841
allprojects {
3942
repositories {
4043
google()
4144
mavenCentral()
42-
jcenter()
4345
}
4446
}
4547

46-
task clean(type: Delete) {
47-
delete rootProject.buildDir
48-
}
48+
spotless {
49+
ratchetFrom 'origin/main'
50+
format 'misc', {
51+
target '**/*.gradle', '**/*.md', '**/.gitignore'
52+
trimTrailingWhitespace()
53+
indentWithSpaces()
54+
endWithNewline()
55+
}
56+
format 'xml', {
57+
target '**/*.xml'
58+
trimTrailingWhitespace()
59+
indentWithSpaces()
60+
endWithNewline()
61+
}
62+
kotlin {
63+
target '**/src/**/*.kt'
64+
ktlint("0.41.0")
65+
licenseHeaderFile rootProject.file('spotless/copyright.kt')
66+
}
67+
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ POM_DEVELOPER_URL=https://github.com/svignesh93
3939
systemProp.org.gradle.internal.publish.checksums.insecure=true
4040

4141
# Increase timeout when pushing to Sonatype (otherwise we get timeouts)s
42-
systemProp.org.gradle.internal.http.socketTimeout=120000
42+
systemProp.org.gradle.internal.http.socketTimeout=120000

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
include ':widgetslib'
2-
rootProject.name = "Widgets"
2+
rootProject.name = "Widgets"

spotless/copyright.kt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright $YEAR LiteKite Startup. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/

widgetslib/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ dependencies {
7373
implementation 'androidx.core:core-ktx:1.3.2'
7474
implementation 'androidx.appcompat:appcompat:1.2.0'
7575
implementation 'com.google.android.material:material:1.3.0'
76-
testImplementation 'junit:junit:4.13.1'
76+
testImplementation 'junit:junit:4.13.2'
7777
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
7878
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
79-
}
79+
}

widgetslib/src/androidTest/java/com/litekite/widget/ExampleInstrumentedTest.kt

+10-12
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,26 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.litekite.widget
1817

19-
import androidx.test.platform.app.InstrumentationRegistry
2018
import androidx.test.ext.junit.runners.AndroidJUnit4
21-
19+
import androidx.test.platform.app.InstrumentationRegistry
20+
import org.junit.Assert.assertEquals
2221
import org.junit.Test
2322
import org.junit.runner.RunWith
2423

25-
import org.junit.Assert.*
26-
2724
/**
2825
* Instrumented test, which will execute on an Android device.
2926
*
3027
* See [testing documentation](http://d.android.com/tools/testing).
3128
*/
3229
@RunWith(AndroidJUnit4::class)
3330
public class ExampleInstrumentedTest {
34-
@Test
35-
public fun useAppContext() {
36-
// Context of the app under test.
37-
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
38-
assertEquals("com.litekite.widgets", appContext.packageName)
39-
}
40-
}
31+
32+
@Test
33+
public fun useAppContext() {
34+
// Context of the app under test.
35+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
36+
assertEquals("com.litekite.widgets", appContext.packageName)
37+
}
38+
}

widgetslib/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
-->
17-
<manifest package="com.litekite.widget" />
17+
<manifest package="com.litekite.widget" />

0 commit comments

Comments
 (0)