Skip to content

Commit

Permalink
Bump DeprecationLevels
Browse files Browse the repository at this point in the history
WARNING -> ERROR
ERROR -> HIDDEN
HIDDEN -> remove
  • Loading branch information
lukellmann committed Nov 22, 2023
1 parent 365b554 commit f87e59f
Show file tree
Hide file tree
Showing 90 changed files with 350 additions and 740 deletions.
274 changes: 130 additions & 144 deletions common/api/common.api

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public sealed class ActivityType(
unused: Nothing?,
) : ActivityType(code) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ActivityType.from()'.",
replaceWith = ReplaceWith(expression = "ActivityType.from(code)", imports =
arrayOf("dev.kord.common.entity.ActivityType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed class AllowedMentionType(
unused: Nothing?,
) : AllowedMentionType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'AllowedMentionType.from()'.",
replaceWith = ReplaceWith(expression = "AllowedMentionType.from(value)", imports =
arrayOf("dev.kord.common.entity.AllowedMentionType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public sealed class ApplicationCommandOptionType(
unused: Nothing?,
) : ApplicationCommandOptionType(type) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ApplicationCommandOptionType.from()'.",
replaceWith = ReplaceWith(expression = "ApplicationCommandOptionType.from(type)",
imports = arrayOf("dev.kord.common.entity.ApplicationCommandOptionType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public sealed class ApplicationCommandPermissionType(
unused: Nothing?,
) : ApplicationCommandPermissionType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ApplicationCommandPermissionType.from()'.",
replaceWith = ReplaceWith(expression = "ApplicationCommandPermissionType.from(value)",
imports =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed class ApplicationCommandType(
unused: Nothing?,
) : ApplicationCommandType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ApplicationCommandType.from()'.",
replaceWith = ReplaceWith(expression = "ApplicationCommandType.from(value)", imports =
arrayOf("dev.kord.common.entity.ApplicationCommandType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import dev.kord.common.java
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.contracts.InvocationKind.EXACTLY_ONCE
import kotlin.contracts.contract
import kotlin.enums.EnumEntries
import kotlin.jvm.JvmField
import kotlin.jvm.JvmName
import kotlin.jvm.JvmStatic
Expand Down Expand Up @@ -70,7 +69,7 @@ public sealed class ApplicationFlag(
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlag is no longer an enum class. Deprecated without a replacement.",
)
public fun name(): String = this::class.simpleName!!
Expand All @@ -80,7 +79,7 @@ public sealed class ApplicationFlag(
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlag is no longer an enum class. Deprecated without a replacement.",
)
public fun ordinal(): Int = when (this) {
Expand All @@ -101,7 +100,7 @@ public sealed class ApplicationFlag(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ApplicationFlag::class.java", imports =
arrayOf("dev.kord.common.entity.ApplicationFlag")),
Expand Down Expand Up @@ -295,7 +294,7 @@ public sealed class ApplicationFlag(
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message =
"ApplicationFlag is no longer an enum class. Deprecated without a replacement.",
)
Expand All @@ -319,37 +318,13 @@ public sealed class ApplicationFlag(
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ApplicationFlag.entries.toTypedArray()", imports
= arrayOf("dev.kord.common.entity.ApplicationFlag")),
)
@JvmStatic
public open fun values(): Array<ApplicationFlag> = entries.toTypedArray()

/**
* @suppress
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED"))
@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ApplicationFlag.entries", imports =
arrayOf("dev.kord.common.entity.ApplicationFlag")),
)
@JvmStatic
public open fun getEntries(): EnumEntries<ApplicationFlag> = EnumEntriesList

@Suppress(names = arrayOf("SEALED_INHERITOR_IN_DIFFERENT_MODULE",
"SEALED_INHERITOR_IN_DIFFERENT_PACKAGE", "UPPER_BOUND_VIOLATED"))
private object EnumEntriesList : EnumEntries<ApplicationFlag>, List<ApplicationFlag> by
entries {
override fun equals(other: Any?): Boolean = entries == other

override fun hashCode(): Int = entries.hashCode()

override fun toString(): String = entries.toString()
}
}
}

Expand Down Expand Up @@ -442,7 +417,7 @@ public class ApplicationFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Renamed to 'values'.",
replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()),
)
Expand Down Expand Up @@ -508,7 +483,7 @@ public class ApplicationFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlags is no longer a data class.",
replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()),
)
Expand All @@ -519,7 +494,7 @@ public class ApplicationFlags internal constructor(
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlags is no longer a data class. Deprecated without a replacement.",
)
public fun copy(code: Int = this.code): ApplicationFlags = ApplicationFlags(code)
Expand Down Expand Up @@ -565,7 +540,7 @@ public class ApplicationFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Renamed to 'build'",
replaceWith = ReplaceWith(expression = "this.build()", imports = arrayOf()),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public sealed class ApplicationRoleConnectionMetadataType(
unused: Nothing?,
) : ApplicationRoleConnectionMetadataType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ApplicationRoleConnectionMetadataType.from()'.",
replaceWith = ReplaceWith(expression =
"ApplicationRoleConnectionMetadataType.from(value)", imports =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed class AuditLogEvent(
unused: Nothing?,
) : AuditLogEvent(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'AuditLogEvent.from()'.",
replaceWith = ReplaceWith(expression = "AuditLogEvent.from(value)", imports =
arrayOf("dev.kord.common.entity.AuditLogEvent")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public sealed class AutoModerationActionType(
unused: Nothing?,
) : AutoModerationActionType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'AutoModerationActionType.from()'.",
replaceWith = ReplaceWith(expression = "AutoModerationActionType.from(value)", imports =
arrayOf("dev.kord.common.entity.AutoModerationActionType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public sealed class AutoModerationRuleEventType(
unused: Nothing?,
) : AutoModerationRuleEventType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'AutoModerationRuleEventType.from()'.",
replaceWith = ReplaceWith(expression = "AutoModerationRuleEventType.from(value)",
imports = arrayOf("dev.kord.common.entity.AutoModerationRuleEventType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public sealed class AutoModerationRuleKeywordPresetType(
unused: Nothing?,
) : AutoModerationRuleKeywordPresetType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'AutoModerationRuleKeywordPresetType.from()'.",
replaceWith = ReplaceWith(expression =
"AutoModerationRuleKeywordPresetType.from(value)", imports =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public sealed class AutoModerationRuleTriggerType(
unused: Nothing?,
) : AutoModerationRuleTriggerType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'AutoModerationRuleTriggerType.from()'.",
replaceWith = ReplaceWith(expression = "AutoModerationRuleTriggerType.from(value)",
imports = arrayOf("dev.kord.common.entity.AutoModerationRuleTriggerType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public sealed class ButtonStyle(
unused: Nothing?,
) : ButtonStyle(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ButtonStyle.from()'.",
replaceWith = ReplaceWith(expression = "ButtonStyle.from(value)", imports =
arrayOf("dev.kord.common.entity.ButtonStyle")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import dev.kord.common.java
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.contracts.InvocationKind.EXACTLY_ONCE
import kotlin.contracts.contract
import kotlin.enums.EnumEntries
import kotlin.jvm.JvmField
import kotlin.jvm.JvmName
import kotlin.jvm.JvmStatic
Expand Down Expand Up @@ -68,7 +67,7 @@ public sealed class ChannelFlag(
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ChannelFlag is no longer an enum class. Deprecated without a replacement.",
)
public fun name(): String = this::class.simpleName!!
Expand All @@ -78,7 +77,7 @@ public sealed class ChannelFlag(
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ChannelFlag is no longer an enum class. Deprecated without a replacement.",
)
public fun ordinal(): Int = when (this) {
Expand All @@ -92,7 +91,7 @@ public sealed class ChannelFlag(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ChannelFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ChannelFlag::class.java", imports =
arrayOf("dev.kord.common.entity.ChannelFlag")),
Expand Down Expand Up @@ -171,7 +170,7 @@ public sealed class ChannelFlag(
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ChannelFlag is no longer an enum class. Deprecated without a replacement.",
)
@JvmStatic
Expand All @@ -187,36 +186,13 @@ public sealed class ChannelFlag(
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ChannelFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ChannelFlag.entries.toTypedArray()", imports =
arrayOf("dev.kord.common.entity.ChannelFlag")),
)
@JvmStatic
public open fun values(): Array<ChannelFlag> = entries.toTypedArray()

/**
* @suppress
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED"))
@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "ChannelFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ChannelFlag.entries", imports =
arrayOf("dev.kord.common.entity.ChannelFlag")),
)
@JvmStatic
public open fun getEntries(): EnumEntries<ChannelFlag> = EnumEntriesList

@Suppress(names = arrayOf("SEALED_INHERITOR_IN_DIFFERENT_MODULE",
"SEALED_INHERITOR_IN_DIFFERENT_PACKAGE", "UPPER_BOUND_VIOLATED"))
private object EnumEntriesList : EnumEntries<ChannelFlag>, List<ChannelFlag> by entries {
override fun equals(other: Any?): Boolean = entries == other

override fun hashCode(): Int = entries.hashCode()

override fun toString(): String = entries.toString()
}
}
}

Expand Down Expand Up @@ -308,7 +284,7 @@ public class ChannelFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Renamed to 'values'.",
replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()),
)
Expand Down Expand Up @@ -372,7 +348,7 @@ public class ChannelFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ChannelFlags is no longer a data class.",
replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()),
)
Expand All @@ -383,7 +359,7 @@ public class ChannelFlags internal constructor(
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ChannelFlags is no longer a data class. Deprecated without a replacement.",
)
public fun copy(code: Int = this.code): ChannelFlags = ChannelFlags(code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public sealed class ChannelType(
unused: Nothing?,
) : ChannelType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ChannelType.from()'.",
replaceWith = ReplaceWith(expression = "ChannelType.from(value)", imports =
arrayOf("dev.kord.common.entity.ChannelType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed class ComponentType(
unused: Nothing?,
) : ComponentType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ComponentType.from()'.",
replaceWith = ReplaceWith(expression = "ComponentType.from(value)", imports =
arrayOf("dev.kord.common.entity.ComponentType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public sealed class DefaultMessageNotificationLevel(
unused: Nothing?,
) : DefaultMessageNotificationLevel(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'DefaultMessageNotificationLevel.from()'.",
replaceWith = ReplaceWith(expression = "DefaultMessageNotificationLevel.from(value)",
imports =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public sealed class DiscordConnectionVisibility(
unused: Nothing?,
) : DiscordConnectionVisibility(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'DiscordConnectionVisibility.from()'.",
replaceWith = ReplaceWith(expression = "DiscordConnectionVisibility.from(value)",
imports = arrayOf("dev.kord.common.entity.DiscordConnectionVisibility")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public sealed class EmbedType(
unused: Nothing?,
) : EmbedType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'EmbedType.from()'.",
replaceWith = ReplaceWith(expression = "EmbedType.from(value)", imports =
arrayOf("dev.kord.common.entity.EmbedType")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed class ExplicitContentFilter(
unused: Nothing?,
) : ExplicitContentFilter(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ExplicitContentFilter.from()'.",
replaceWith = ReplaceWith(expression = "ExplicitContentFilter.from(value)", imports =
arrayOf("dev.kord.common.entity.ExplicitContentFilter")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed class ForumLayoutType(
unused: Nothing?,
) : ForumLayoutType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "Replaced by 'ForumLayoutType.from()'.",
replaceWith = ReplaceWith(expression = "ForumLayoutType.from(value)", imports =
arrayOf("dev.kord.common.entity.ForumLayoutType")),
Expand Down
Loading

0 comments on commit f87e59f

Please sign in to comment.