@@ -18,29 +18,31 @@ import com.akuleshov7.ktoml.TomlInputConfig
18
18
import com.akuleshov7.ktoml.exceptions.TomlDecodingException
19
19
import com.akuleshov7.ktoml.file.TomlFileReader
20
20
import com.akuleshov7.ktoml.parsers.TomlParser
21
- import com.akuleshov7.ktoml.tree.TomlTable
21
+ import com.akuleshov7.ktoml.tree.nodes. TomlTable
22
22
import okio.FileSystem
23
23
import okio.Path
24
24
25
25
import kotlinx.serialization.ExperimentalSerializationApi
26
26
import kotlinx.serialization.serializer
27
27
28
28
private fun Path.testConfigFactory (table : TomlTable ) =
29
- when (table.fullTableName.uppercase().replace(" \" " , " " )) {
29
+ when (table.fullTableName()
30
+ .uppercase()
31
+ .replace(" \" " , " " )) {
30
32
TestConfigSections .FIX .name -> this .createPluginConfig<FixPluginConfig >(
31
- table.fullTableName
33
+ table.fullTableName()
32
34
)
33
35
TestConfigSections .`FIX AND WARN `.name -> this .createPluginConfig<FixAndWarnPluginConfig >(
34
- table.fullTableName
36
+ table.fullTableName()
35
37
)
36
38
TestConfigSections .WARN .name -> this .createPluginConfig<WarnPluginConfig >(
37
- table.fullTableName
39
+ table.fullTableName()
38
40
)
39
41
TestConfigSections .GENERAL .name -> this .createPluginConfig<GeneralConfig >(
40
- table.fullTableName
42
+ table.fullTableName()
41
43
)
42
44
else -> throw PluginException (
43
- " Received unknown plugin section name in the input: [${table.fullTableName} ]." +
45
+ " Received unknown plugin section name in the input: [${table.fullTableName() } ]." +
44
46
" Please check your <$this > config"
45
47
)
46
48
}
@@ -67,6 +69,8 @@ private inline fun <reified T : PluginConfig> Path.createPluginConfig(
67
69
throw e
68
70
}
69
71
72
+ private fun TomlTable.fullTableName (): String = fullTableKey.toString()
73
+
70
74
/* *
71
75
* Create the list of plugins from toml file with plugin sections
72
76
*
0 commit comments