Skip to content

Commit

Permalink
chore(deps): bumps Spotless to 6.25.0 and associated fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealAgentK committed Sep 6, 2024
1 parent 34c04aa commit 8990dd4
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 58 deletions.
58 changes: 30 additions & 28 deletions app/src/main/java/com/raygun/raygun4android/sample/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import com.raygun.raygun4android.RaygunClient
import com.raygun.raygun4android.messages.shared.RaygunUserInfo

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Expand Down Expand Up @@ -52,10 +51,10 @@ class MainActivity : AppCompatActivity() {
tw,
)
Snackbar.make(
it,
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand All @@ -64,7 +63,8 @@ class MainActivity : AppCompatActivity() {
val i = 3 / 0
Log.d(
"Raygun4Android-Sample",
"This is here purely so that our division by zero calculation in i gets used and not optimised away in a release build: $i",
"This is here purely so that our division by zero calculation in i gets used and not optimised away " +
"in a release build: $i",
)
}

Expand All @@ -74,19 +74,21 @@ class MainActivity : AppCompatActivity() {
val i = 3 / 0
Log.d(
"Raygun4Android-Sample",
"This is here purely so that our division by zero calculation in i gets used and not optimised away in a release build: $i",
"This is here purely so that our division by zero calculation in i gets used and not optimised away " +
"in a release build: $i",
)
} catch (ex: Exception) {
val i = 4
Log.d(
"Raygun4Android-Sample",
"This is here purely so that our alternative value for i gets used and not optimised away in a release build: $i",
"This is here purely so that our alternative value for i gets used and not optimised away " +
"in a release build: $i",
)
Snackbar.make(
it,
getString(R.string.you_just_created_and_caught_an_exception),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.you_just_created_and_caught_an_exception),
Snackbar.LENGTH_SHORT,
)
.show()
}
}
Expand All @@ -95,10 +97,10 @@ class MainActivity : AppCompatActivity() {
val user = RaygunUserInfo()
RaygunClient.setUser(user)
Snackbar.make(
it,
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand All @@ -110,10 +112,10 @@ class MainActivity : AppCompatActivity() {
RaygunClient.setUser(user)
RaygunClient.recordBreadcrumb("I'm now user A")
Snackbar.make(
it,
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand All @@ -125,10 +127,10 @@ class MainActivity : AppCompatActivity() {
RaygunClient.setUser(user)
RaygunClient.recordBreadcrumb("I'm now user B")
Snackbar.make(
it,
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand Down Expand Up @@ -161,10 +163,10 @@ class MainActivity : AppCompatActivity() {
if (result.resultCode == RESULT_OK) {
val rootView: View = findViewById(android.R.id.content)
Snackbar.make(
rootView,
getString(R.string.we_returned_to_first_activity),
Snackbar.LENGTH_SHORT,
)
rootView,
getString(R.string.we_returned_to_first_activity),
Snackbar.LENGTH_SHORT,
)
.show()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.raygun.raygun4android.messages.shared.RaygunUserInfo
import java.util.WeakHashMap

class SecondActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_second)
Expand Down Expand Up @@ -46,10 +45,10 @@ class SecondActivity : AppCompatActivity() {
tw,
)
Snackbar.make(
it,
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.you_have_just_sent_an_error_with_raygun4android),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand All @@ -58,7 +57,8 @@ class SecondActivity : AppCompatActivity() {
val i = 3 / 0
Log.d(
"Raygun4Android-Sample",
"This is here purely so that our division by zero calculation in i gets used and not optimised away in a release build: $i",
"This is here purely so that our division by zero calculation in i gets used and not optimised away " +
"in a release build: $i",
)
}

Expand All @@ -68,19 +68,21 @@ class SecondActivity : AppCompatActivity() {
val i = 3 / 0
Log.d(
"Raygun4Android-Sample",
"This is here purely so that our division by zero calculation in i gets used and not optimised away in a release build: $i",
"This is here purely so that our division by zero calculation in i gets used and not optimised away " +
"in a release build: $i",
)
} catch (ex: Exception) {
val i = 4
Log.d(
"Raygun4Android-Sample",
"This is here purely so that our alternative value for i gets used and not optimised away in a release build: $i",
"This is here purely so that our alternative value for i gets used and not optimised away " +
"in a release build: $i",
)
Snackbar.make(
it,
getString(R.string.you_just_created_and_caught_an_exception),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.you_just_created_and_caught_an_exception),
Snackbar.LENGTH_SHORT,
)
.show()
}
}
Expand All @@ -89,10 +91,10 @@ class SecondActivity : AppCompatActivity() {
val user = RaygunUserInfo()
RaygunClient.setUser(user)
Snackbar.make(
it,
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.user_is_now_set_to_anonymous_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand All @@ -104,10 +106,10 @@ class SecondActivity : AppCompatActivity() {
RaygunClient.setUser(user)
RaygunClient.recordBreadcrumb("I'm now user A")
Snackbar.make(
it,
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.user_is_now_set_to_user_a_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand All @@ -119,10 +121,10 @@ class SecondActivity : AppCompatActivity() {
RaygunClient.setUser(user)
RaygunClient.recordBreadcrumb("I'm now user B")
Snackbar.make(
it,
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
it,
getString(R.string.user_is_now_set_to_user_b_for_future_raygun_reports),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand Down Expand Up @@ -169,10 +171,10 @@ class SecondActivity : AppCompatActivity() {
RaygunClient.recordBreadcrumb(breadcrumbMessage)
val rootView: View = findViewById(android.R.id.content)
Snackbar.make(
rootView,
getString(R.string.we_re_now_on_the_second_activity_screen),
Snackbar.LENGTH_SHORT,
)
rootView,
getString(R.string.we_re_now_on_the_second_activity_screen),
Snackbar.LENGTH_SHORT,
)
.show()
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ leakcanary = "2.14"
kotlin = "1.8.22"
gradle = "8.1.1"
raygun = "4.0.1"
spotless = "6.12.1"
spotless = "6.25.0"

[libraries]
android-material-material = { module = "com.google.android.material:material", version.ref = "android-material" }
Expand Down
3 changes: 2 additions & 1 deletion spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ spotless {
}
kotlin {
target '**/*.kt'
ktlint()
ktfmt().googleStyle().configure {
it.setBlockIndent(4)
it.setContinuationIndent(4)
}
ktlint()
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
Expand All @@ -26,6 +26,7 @@ spotless {
}
format 'xml', {
target '**/*.xml'
targetExclude '.idea/**/*.xml'
indentWithSpaces()
trimTrailingWhitespace()
endWithNewline()
Expand Down

0 comments on commit 8990dd4

Please sign in to comment.