From 1bd054c7c5ca1a11d1f37a9f91e37140efcb1ec4 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 19 Jun 2021 12:59:14 +0200 Subject: [PATCH] Disable a few rules + edit the configurations in Formatting.yml, and add a parameter name to a lambda argument in ConfigScreen.kt --- Formatting.yml | 15 ++++++++++++--- .../username404/snowygui/config/ConfigScreen.kt | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Formatting.yml b/Formatting.yml index 686945b..d31aac5 100644 --- a/Formatting.yml +++ b/Formatting.yml @@ -14,9 +14,6 @@ valueParameter: true collectionLiteral: true -- name: UNUSED_IMPORT - enabled: true - - name: CUSTOM_GETTERS_SETTERS enabled: false @@ -27,6 +24,18 @@ alignedParameters: true indentationSize: 4 +- name: NO_BRACES_IN_CONDITIONALS_AND_LOOPS + enabled: false + +- name: MAGIC_NUMBER + enabled: true + configuration: + ignoreEnums: true + ignoreExtensionFunctions: true + +- name: CLASS_SHOULD_NOT_BE_ABSTRACT + enabled: false + - name: TYPEALIAS_NAME_INCORRECT_CASE enabled: false diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt index b7d031c..9e41c02 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt @@ -63,11 +63,11 @@ val SnowyConfigScreen: Screen get() { macrosButtons.getTitleCommand() ).setInsertInFront(false).setDefaultValue(Configuration.foundMacros.getTitleCommand()).setErrorSupplier { list -> supplyComponent(if (list.size > buttonsMax) "$confPrefix.general.macros.toomuchbuttons" else null) - }.setCellErrorSupplier { - with(it.split(":")) { + }.setCellErrorSupplier { cell -> + with(cell.split(":")) { supplyComponent( when { - isEmpty() || !it.contains(":") -> "$confPrefix.general.macros.missingdelimiter" + isEmpty() || !cell.contains(":") -> "$confPrefix.general.macros.missingdelimiter" size < 2 -> "$confPrefix.general.macros.missingelement" size > 2 -> "$confPrefix.general.macros.toomuchdelimiters" first().count() > 16 -> "$confPrefix.general.macros.toomuchcharacters"