Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
### What's done:
* Review
  • Loading branch information
kgevorkyan committed Jan 24, 2023
1 parent cc3962e commit ddf6ed0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.serializer

private fun Path.testConfigFactory(table: TomlTable) =
when (table.fullTableKey.toString()
when (table.fullTableName()
.uppercase()
.replace("\"", "")) {
TestConfigSections.FIX.name -> this.createPluginConfig<FixPluginConfig>(
table.fullTableKey.toString()
table.fullTableName()
)
TestConfigSections.`FIX AND WARN`.name -> this.createPluginConfig<FixAndWarnPluginConfig>(
table.fullTableKey.toString()
table.fullTableName()
)
TestConfigSections.WARN.name -> this.createPluginConfig<WarnPluginConfig>(
table.fullTableKey.toString()
table.fullTableName()
)
TestConfigSections.GENERAL.name -> this.createPluginConfig<GeneralConfig>(
table.fullTableKey.toString()
table.fullTableName()
)
else -> throw PluginException(
"Received unknown plugin section name in the input: [${table.fullTableKey}]." +
"Received unknown plugin section name in the input: [${table.fullTableName()}]." +
" Please check your <$this> config"
)
}
Expand All @@ -69,6 +69,8 @@ private inline fun <reified T : PluginConfig> Path.createPluginConfig(
throw e
}

private fun TomlTable.fullTableName(): String = fullTableKey.toString()

/**
* Create the list of plugins from toml file with plugin sections
*
Expand Down

0 comments on commit ddf6ed0

Please sign in to comment.