Use diktat directly instead of the spotless gradle plugin and improve a few files
This commit is contained in:
parent
59370fab4c
commit
b34cb151ab
@ -7,6 +7,13 @@
|
|||||||
- name: SAY_NO_TO_VAR
|
- name: SAY_NO_TO_VAR
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
- name: TRAILING_COMMA
|
||||||
|
enabled: true
|
||||||
|
configuration:
|
||||||
|
valueArgument: true
|
||||||
|
valueParameter: true
|
||||||
|
collectionLiteral: true
|
||||||
|
|
||||||
- name: UNUSED_IMPORT
|
- name: UNUSED_IMPORT
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
@ -15,6 +22,10 @@
|
|||||||
|
|
||||||
- name: WRONG_INDENTATION
|
- name: WRONG_INDENTATION
|
||||||
enabled: true
|
enabled: true
|
||||||
|
configuration:
|
||||||
|
extendedIndentOfParameters: false
|
||||||
|
alignedParameters: true
|
||||||
|
indentationSize: 4
|
||||||
|
|
||||||
- name: TYPEALIAS_NAME_INCORRECT_CASE
|
- name: TYPEALIAS_NAME_INCORRECT_CASE
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@ -17,7 +17,7 @@ plugins {
|
|||||||
id("dev.architectury.loom") version "[0.7.2.110, 0.9.0[" apply false
|
id("dev.architectury.loom") version "[0.7.2.110, 0.9.0[" apply false
|
||||||
id("com.github.ben-manes.versions") version "0.39.0"
|
id("com.github.ben-manes.versions") version "0.39.0"
|
||||||
id("net.kyori.indra.git") version "2.0.5"
|
id("net.kyori.indra.git") version "2.0.5"
|
||||||
id("com.diffplug.spotless") version "5.12.5"
|
id("org.cqfn.diktat.diktat-gradle-plugin") version "0.6.2"
|
||||||
id("com.modrinth.minotaur") version "1.2.1"
|
id("com.modrinth.minotaur") version "1.2.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,6 +39,12 @@ val kotlinX: String = "org.jetbrains.kotlinx"
|
|||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
group = rootProject.group.toString()
|
group = rootProject.group.toString()
|
||||||
|
apply(plugin = "org.cqfn.diktat.diktat-gradle-plugin")
|
||||||
|
diktat {
|
||||||
|
inputs = files("src/**/*.kt")
|
||||||
|
diktatConfigFile = file("$rootDir/Formatting.yml")
|
||||||
|
ignoreFailures = true
|
||||||
|
}
|
||||||
lateinit var mappingsDep: Dependency
|
lateinit var mappingsDep: Dependency
|
||||||
apply(plugin = "dev.architectury.loom")
|
apply(plugin = "dev.architectury.loom")
|
||||||
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
|
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
|
||||||
@ -146,6 +152,7 @@ subprojects {
|
|||||||
input.set(shrinkedJar)
|
input.set(shrinkedJar)
|
||||||
if (!archiveFileName.get().contains("common")) destinationDirectory.set(file("$rootDir/remappedJars"))
|
if (!archiveFileName.get().contains("common")) destinationDirectory.set(file("$rootDir/remappedJars"))
|
||||||
}
|
}
|
||||||
|
build.get().dependsOn(diktatCheck)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,16 +169,6 @@ allprojects {
|
|||||||
**/
|
**/
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||||
apply(plugin = "com.diffplug.spotless")
|
|
||||||
spotless {
|
|
||||||
encoding = Charsets.UTF_8
|
|
||||||
kotlin {
|
|
||||||
ignoreErrorForStep("diktat")
|
|
||||||
diktat("0.6.1").configFile("$rootDir/Formatting.yml")
|
|
||||||
trimTrailingWhitespace(); endWithNewline()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tasks.spotlessCheck.get().finalizedBy(tasks.spotlessApply)
|
|
||||||
apply(plugin = "architectury-plugin")
|
apply(plugin = "architectury-plugin")
|
||||||
val compiler = javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(sourceJavaVer.toInt())) }
|
val compiler = javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(sourceJavaVer.toInt())) }
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -2,7 +2,10 @@ package fr.username404.snowygui.config
|
|||||||
|
|
||||||
import com.typesafe.config.Config
|
import com.typesafe.config.Config
|
||||||
import com.typesafe.config.ConfigException
|
import com.typesafe.config.ConfigException
|
||||||
import com.typesafe.config.ConfigFactory.*
|
import com.typesafe.config.ConfigFactory.empty
|
||||||
|
import com.typesafe.config.ConfigFactory.parseFile
|
||||||
|
import com.typesafe.config.ConfigFactory.load
|
||||||
|
import com.typesafe.config.ConfigFactory.parseString
|
||||||
import com.typesafe.config.ConfigRenderOptions
|
import com.typesafe.config.ConfigRenderOptions
|
||||||
import com.typesafe.config.ConfigValueFactory
|
import com.typesafe.config.ConfigValueFactory
|
||||||
import fr.username404.snowygui.ClickGui
|
import fr.username404.snowygui.ClickGui
|
||||||
|
@ -4,12 +4,13 @@ import net.minecraft.client.Minecraft
|
|||||||
|
|
||||||
@ButtonInfo(Category.MISC)
|
@ButtonInfo(Category.MISC)
|
||||||
object GammaBoost: ButtonImpl() {
|
object GammaBoost: ButtonImpl() {
|
||||||
|
private const val boost = 1400.0
|
||||||
private var oldGamma = 0.0
|
private var oldGamma = 0.0
|
||||||
override fun execAction() {
|
override fun execAction() {
|
||||||
with(Minecraft.getInstance().options) {
|
with(Minecraft.getInstance().options) {
|
||||||
gamma = if (toggled) {
|
gamma = if (toggled) {
|
||||||
if (gamma < 1400.0) oldGamma = gamma
|
if (gamma < boost) oldGamma = gamma
|
||||||
1400.0
|
boost
|
||||||
} else oldGamma
|
} else oldGamma
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,14 @@ private typealias privateLambda = (() -> Unit)?
|
|||||||
object AddKeyMaps {
|
object AddKeyMaps {
|
||||||
private const val prefix = "snowy"
|
private const val prefix = "snowy"
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
internal fun mkMap(translationSuffix: String, key: Int, category: String = "keycategory", lambda: privateLambda = null): Pair<KeyMapping, privateLambda> {
|
internal fun mkMap(
|
||||||
return KeyMapping(
|
translationSuffix: String,
|
||||||
"key.$prefix.$translationSuffix", InputConstants.Type.KEYSYM,
|
key: Int, category: String = "keycategory",
|
||||||
key, "category.$prefix.$category"
|
lambda: privateLambda = null
|
||||||
) to lambda
|
): Pair<KeyMapping, privateLambda> = KeyMapping(
|
||||||
}
|
"key.$prefix.$translationSuffix", InputConstants.Type.KEYSYM,
|
||||||
|
key, "category.$prefix.$category"
|
||||||
|
) to lambda
|
||||||
val list: MutableMap<KeyMapping, privateLambda> = with(Minecraft.getInstance()) {
|
val list: MutableMap<KeyMapping, privateLambda> = with(Minecraft.getInstance()) {
|
||||||
mutableMapOf(
|
mutableMapOf(
|
||||||
mkMap("opengui", GLFW_KEY_Y) { setScreen(ClickGui) },
|
mkMap("opengui", GLFW_KEY_Y) { setScreen(ClickGui) },
|
||||||
|
Loading…
Reference in New Issue
Block a user