Skip to content

Commit

Permalink
Merge pull request #11830 from nextcloud/dependabot/gradle/com.diffpl…
Browse files Browse the repository at this point in the history
…ug.spotless-6.20.0

Build(deps): Bump com.diffplug.spotless from 6.19.0 to 6.20.0
  • Loading branch information
AndyScherzinger authored Jul 24, 2023
2 parents 37e1517 + 997fdbe commit cacc62a
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 26 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {
}

plugins {
id "com.diffplug.spotless" version "6.19.0"
id "com.diffplug.spotless" version "6.20.0"
}

apply plugin: 'com.android.application'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class ManualAsyncRunner : AsyncRunner {
): Cancellable {
val remove: Function1<Runnable, Boolean> = queue::remove
val taskWrapper = Task(
postResult = { it.run(); true },
postResult = {
it.run()
true
},
removeFromQueue = remove,
taskBody = task,
onSuccess = onResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ class ShowErrorActivity : AppCompatActivity() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.error_share -> {
onClickedShare(); true
onClickedShare()
true
}
else -> super.onOptionsItemSelected(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class EtmAccountsFragment : EtmBaseFragment() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.etm_accounts_share -> {
onClickedShare(); true
onClickedShare()
true
}
else -> super.onOptionsItemSelected(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,24 @@ class EtmBackgroundJobsFragment : EtmBaseFragment() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.etm_background_jobs_cancel -> {
vm.cancelAllJobs(); true
vm.cancelAllJobs()
true
}
R.id.etm_background_jobs_prune -> {
vm.pruneJobs(); true
vm.pruneJobs()
true
}
R.id.etm_background_jobs_start_test -> {
vm.startTestJob(periodic = false); true
vm.startTestJob(periodic = false)
true
}
R.id.etm_background_jobs_schedule_test -> {
vm.startTestJob(periodic = true); true
vm.startTestJob(periodic = true)
true
}
R.id.etm_background_jobs_cancel_test -> {
vm.cancelTestJob(); true
vm.cancelTestJob()
true
}
else -> super.onOptionsItemSelected(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ class EtmFileTransferFragment : EtmBaseFragment() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.etm_test_download -> {
scheduleTestDownload(); true
scheduleTestDownload()
true
}
R.id.etm_test_upload -> {
scheduleTestUpload(); true
scheduleTestUpload()
true
}
else -> super.onOptionsItemSelected(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class EtmMigrations : EtmBaseFragment() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.etm_migrations_delete -> {
onDeleteMigrationsClicked(); true
onDeleteMigrationsClicked()
true
}
else -> super.onOptionsItemSelected(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class EtmPreferencesFragment : EtmBaseFragment() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.etm_preferences_share -> {
onClickedShare(); true
onClickedShare()
true
}
else -> super.onOptionsItemSelected(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,27 @@ class TransferManagerImpl(
runner.postTask(
task = createDownloadTask(request),
onProgress = { progress: Int -> registry.progress(uuid, progress) },
onResult = { result -> registry.complete(uuid, result.success, result.file); registry.startNext() },
onError = { registry.complete(uuid, false); registry.startNext() }
onResult = { result ->
registry.complete(uuid, result.success, result.file)
registry.startNext()
},
onError = {
registry.complete(uuid, false)
registry.startNext()
}
)
} else if (request is UploadRequest) {
runner.postTask(
task = createUploadTask(request),
onProgress = { progress: Int -> registry.progress(uuid, progress) },
onResult = { result -> registry.complete(uuid, result.success, result.file); registry.startNext() },
onError = { registry.complete(uuid, false); registry.startNext() }
onResult = { result ->
registry.complete(uuid, result.success, result.file)
registry.startNext()
},
onError = {
registry.complete(uuid, false)
registry.startNext()
}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ class LogsEmailSender(private val context: Context, private val clock: Clock, pr
fun send(logs: List<LogEntry>) {
if (task == null) {
val outFile = File(context.cacheDir, "attachments/logs.txt")
task = runner.postQuickTask(Task(context, logs, outFile, clock.tz), onResult = { task = null; send(it) })
task = runner.postQuickTask(Task(context, logs, outFile, clock.tz), onResult = {
task = null
send(it)
})
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ open class FileSortOrder(@JvmField var name: String, var isAscending: Boolean) {

@Suppress("EnumNaming", "EnumEntryName") // already saved in user preferences -.-'
enum class Type {
trashBinView, localFileListView // ktlint-disable enum-entry-name-case
trashBinView,

@Suppress("ktlint:standard:enum-entry-name-case")
localFileListView
}

enum class SortType {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/dims.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<dimen name="scroll_view_height">180dp</dimen>
<dimen name="upload_list_item_frame_layout_width">60dp</dimen>
<dimen name="upload_list_item_text_size">12sp</dimen>
<dimen name="upload_list_item_image_size">24dp</dimen>
<dimen name="uploader_list_item_layout_image_margin">12dp</dimen>
<dimen name="media_grid_spacing">2dp</dimen>
<dimen name="account_item_layout_user_image_left_start_margin">12dp</dimen>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ class ManualAsyncRunnerTest {
MockitoAnnotations.initMocks(this)
runner = ManualAsyncRunner()
taskCalls = EMPTY
whenever(task.invoke()).thenAnswer { taskCalls++; taskCalls }
whenever(task.invoke()).thenAnswer {
taskCalls++
taskCalls
}
}

@Test
Expand Down
5 changes: 4 additions & 1 deletion app/src/test/java/com/nextcloud/client/core/TaskTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ class TaskTest {
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
val postResult = { r: Runnable -> r.run(); true }
val postResult = { r: Runnable ->
r.run()
true
}
task = Task(this::post, removeFromQueue, taskBody, onResult, onError, onProgress)
}

Expand Down
15 changes: 12 additions & 3 deletions app/src/test/java/com/nextcloud/client/logger/LoggerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,18 @@ class LoggerTest {
val tag = "test tag"
val message = "test log message"
val latch = CountDownLatch(LATCH_INIT)
doAnswer { it.callRealMethod(); latch.countDown() }.whenever(logHandler).open()
doAnswer { it.callRealMethod(); latch.countDown() }.whenever(logHandler).write(any())
doAnswer { it.callRealMethod(); latch.countDown() }.whenever(logHandler).close()
doAnswer {
it.callRealMethod()
latch.countDown()
}.whenever(logHandler).open()
doAnswer {
it.callRealMethod()
latch.countDown()
}.whenever(logHandler).write(any())
doAnswer {
it.callRealMethod()
latch.countDown()
}.whenever(logHandler).close()

// GIVEN
// logger event loop is running
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ class LogsViewModelTest {
var onLoadedCallback: OnLogsLoaded? = null

override val lostEntries: Boolean = false
override fun load(onLoaded: OnLogsLoaded) { this.onLoadedCallback = onLoaded; loadRequestCount++ }
override fun load(onLoaded: OnLogsLoaded) {
this.onLoadedCallback = onLoaded
loadRequestCount++
}
override fun deleteAll() {
/* no implementation needed */
}
Expand Down

0 comments on commit cacc62a

Please sign in to comment.