Skip to content

Commit

Permalink
Reformat with Spotless (#8180)
Browse files Browse the repository at this point in the history
* Enable spotless

* Run spotlessApply

* Fixup trimMargin

* Re-run spotlessApply
  • Loading branch information
squarejesse authored Jan 8, 2024
1 parent 0e312d7 commit a228fd6
Show file tree
Hide file tree
Showing 442 changed files with 24,924 additions and 18,474 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ root = true

[*]
indent_size = 2
ij_continuation_indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{kt, kts}]
kotlin_imports_layout = ascii
ij_kotlin_imports_layout = *
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import org.junit.Test
* Run with "./gradlew :android-test-app:connectedCheck -PandroidBuild=true" and make sure ANDROID_SDK_ROOT is set.
*/
class PublicSuffixDatabaseTest {

@Test
fun testTopLevelDomain() {
assertThat("https://www.google.com/robots.txt".toHttpUrl().topPrivateDomain()).isEqualTo("google.com")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,13 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import okhttp3.Call
import okhttp3.Callback
import okhttp3.CookieJar
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.internal.publicsuffix.PublicSuffixDatabase
import okio.FileSystem
import okio.IOException
import okio.Path.Companion.toPath
import java.net.CookieHandler
import java.net.URI

class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand All @@ -41,15 +34,23 @@ class MainActivity : ComponentActivity() {
val url = "https://github.com/square/okhttp".toHttpUrl()
println(url.topPrivateDomain())

client.newCall(Request(url)).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
println("failed: $e")
}
client.newCall(Request(url)).enqueue(
object : Callback {
override fun onFailure(
call: Call,
e: IOException,
) {
println("failed: $e")
}

override fun onResponse(call: Call, response: Response) {
println("response: ${response.code}")
response.close()
}
})
override fun onResponse(
call: Call,
response: Response,
) {
println("response: ${response.code}")
response.close()
}
},
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ package okhttp.android.testapp

import android.app.Application

class TestApplication: Application() {
}
class TestApplication : Application()
Loading

0 comments on commit a228fd6

Please sign in to comment.