Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend: Better formatting settings #3104

Merged
merged 7 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ij_java_names_count_to_use_import_on_demand = 2147483647
ij_java_class_count_to_use_import_on_demand = 2147483647
ij_java_packages_to_use_import_on_demand = 2147483647

# Kotlin Files
[*.kt]
ktlint_code_style = intellij_idea

Expand Down Expand Up @@ -59,3 +60,9 @@ ktlint_standard_final-newline = disabled

ktlint_standard_no-wildcard-imports = enabled
ktlint_standard_function-expression-body = disabled

# Additional Kotlin-specific formatting for conditions and continuation
ij_kotlin_continuation_indent_size = 8
ij_kotlin_binary_expression_wrap = if_long
ij_kotlin_keep_line_breaks = true
ij_kotlin_annotations_new_line_after_suppress = true
9 changes: 5 additions & 4 deletions detekt/detekt.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

config:
validation: true

Expand All @@ -24,7 +23,6 @@ ImportRules:
CustomImportOrdering:
active: true


style:
MagicNumber: # I, Linnea Gräf, of sound mind and body, disagree with disabling this rule
active: false
Expand Down Expand Up @@ -87,8 +85,11 @@ formatting:
active: false
ImportOrdering: # handled by custom rule
active: false
AnnotationSpacing: # handled by custom rule
active: false
AnnotationSpacing: # enabled to ensure proper annotation placement
active: true
includeAnnotations: ["Suppress"] # Only enforce for @Suppress
excludeAnnotations: [] # Do not exclude any other annotations
newLineBeforeAnnotation: true # Place annotation on its own line

complexity:
CyclomaticComplexMethod: # default threshold of 15, caught almost every complex method
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/data/BossbarData.kt
hannibal002 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package at.hannibal2.skyhanni.data

//#if MC < 1.12
import at.hannibal2.skyhanni.events.BossbarUpdateEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
//#if MC < 1.12
import at.hannibal2.skyhanni.events.LorenzTickEvent
import net.minecraft.entity.boss.BossStatus
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

//#else
//$$ import net.minecraftforge.client.event.RenderGameOverlayEvent
//#endif
Expand All @@ -25,8 +26,8 @@ object BossbarData {
bossbar = null
}

@SubscribeEvent
//#if MC < 1.12
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
val bossbarLine = BossStatus.bossName ?: return
//#else
Expand Down
Loading