From 79c207dea02738d413f66bb90aad49e3d9b56387 Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Thu, 15 Aug 2019 22:14:40 +0200 Subject: [PATCH] Trim whitespaces in parsed disabled rules values. Signed-off-by: Yahor Berdnikau --- .../src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt b/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt index dc652b5fc8..d711633bbe 100644 --- a/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt +++ b/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt @@ -230,7 +230,10 @@ object KtLint { node.putUserData(FILE_PATH_USER_DATA_KEY, userData["file_path"]) node.putUserData(EDITOR_CONFIG_USER_DATA_KEY, EditorConfig.fromMap(editorConfigMap - "android" - "file_path")) node.putUserData(ANDROID_USER_DATA_KEY, android) - node.putUserData(DISABLED_RULES, userData["disabled_rules"]?.split(",")?.toSet() ?: emptySet()) + node.putUserData( + DISABLED_RULES, + userData["disabled_rules"]?.split(",")?.map { it.trim() }?.toSet() ?: emptySet() + ) } private fun visitor(