Merge pull request #11830 from nextcloud/dependabot/gradle/com.diffplug.spotless-6.20.0

Build(deps): Bump com.diffplug.spotless from 6.19.0 to 6.20.0
This commit is contained in:
Andy Scherzinger 2023-07-24 18:01:44 +02:00 committed by GitHub
commit cacc62a1a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 75 additions and 26 deletions

View file

@ -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'

View file

@ -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,

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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()
}
)
}
}

View file

@ -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)
})
}
}

View file

@ -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 {

View file

@ -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>

View file

@ -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

View file

@ -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)
}

View file

@ -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

View file

@ -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 */
}