Эх сурвалжийг харах

Fix code analytics

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 жил өмнө
parent
commit
d48b043e02

+ 1 - 1
app/src/androidTest/java/com/nextcloud/utils/FileNameValidatorTests.kt

@@ -16,7 +16,7 @@ import org.junit.Assert.assertNull
 import org.junit.Assert.assertTrue
 import org.junit.Test
 
-class FileNameValidatorTests: AbstractIT() {
+class FileNameValidatorTests : AbstractIT() {
 
     @Test
     fun testInvalidCharacter() {

+ 4 - 1
app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt

@@ -22,8 +22,11 @@ object FileNameValidator {
         "LPT¹", "LPT²", "LPT³"
     )
 
+    @Suppress("ReturnCount")
     fun isValid(name: String, context: Context, fileNames: MutableSet<String>? = null): String? {
-        val invalidCharacter = name.find { it.toString().matches(reservedWindowsChars) || it.toString().matches(reservedUnixChars) }
+        val invalidCharacter = name.find {
+            it.toString().matches(reservedWindowsChars) || it.toString().matches(reservedUnixChars)
+        }
         if (invalidCharacter != null) {
             return context.getString(R.string.file_name_validator_error_invalid_character, invalidCharacter)
         }