Skip to content

Commit

Permalink
Bump DeprecationLevels (#879)
Browse files Browse the repository at this point in the history
WARNING -> ERROR
ERROR -> HIDDEN
HIDDEN -> remove
  • Loading branch information
lukellmann authored Sep 19, 2023
1 parent 99e6506 commit f2fe43e
Show file tree
Hide file tree
Showing 98 changed files with 283 additions and 753 deletions.
32 changes: 14 additions & 18 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public abstract class dev/kord/common/entity/ActivityFlag {
public synthetic fun <init> (ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun equals (Ljava/lang/Object;)Z
public final fun getDeclaringClass ()Ljava/lang/Class;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getShift ()I
public final fun getValue ()I
public final fun hashCode ()I
Expand All @@ -211,7 +211,7 @@ public abstract class dev/kord/common/entity/ActivityFlag {
public final class dev/kord/common/entity/ActivityFlag$Companion {
public final fun fromShift (I)Ldev/kord/common/entity/ActivityFlag;
public final fun getEntries ()Ljava/util/List;
public fun getEntries ()Lkotlin/enums/EnumEntries;
public synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ActivityFlag;
public fun values ()[Ldev/kord/common/entity/ActivityFlag;
}
Expand Down Expand Up @@ -640,7 +640,7 @@ public abstract class dev/kord/common/entity/ApplicationFlag {
public final fun equals (Ljava/lang/Object;)Z
public final fun getCode ()I
public final fun getDeclaringClass ()Ljava/lang/Class;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getShift ()I
public final fun hashCode ()I
public final fun name ()Ljava/lang/String;
Expand All @@ -663,7 +663,7 @@ public final class dev/kord/common/entity/ApplicationFlag$ApplicationCommandBadg
public final class dev/kord/common/entity/ApplicationFlag$Companion {
public final fun fromShift (I)Ldev/kord/common/entity/ApplicationFlag;
public final fun getEntries ()Ljava/util/List;
public fun getEntries ()Lkotlin/enums/EnumEntries;
public synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ApplicationFlag;
public fun values ()[Ldev/kord/common/entity/ApplicationFlag;
}
Expand Down Expand Up @@ -1701,7 +1701,7 @@ public abstract class dev/kord/common/entity/ChannelFlag {
public final fun equals (Ljava/lang/Object;)Z
public final fun getCode ()I
public final fun getDeclaringClass ()Ljava/lang/Class;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getShift ()I
public final fun hashCode ()I
public final fun name ()Ljava/lang/String;
Expand All @@ -1716,7 +1716,7 @@ public abstract class dev/kord/common/entity/ChannelFlag {
public final class dev/kord/common/entity/ChannelFlag$Companion {
public final fun fromShift (I)Ldev/kord/common/entity/ChannelFlag;
public final fun getEntries ()Ljava/util/List;
public fun getEntries ()Lkotlin/enums/EnumEntries;
public synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ChannelFlag;
public fun values ()[Ldev/kord/common/entity/ChannelFlag;
}
Expand Down Expand Up @@ -6918,7 +6918,7 @@ public abstract class dev/kord/common/entity/GuildMemberFlag {
public final fun equals (Ljava/lang/Object;)Z
public final fun getCode ()I
public final fun getDeclaringClass ()Ljava/lang/Class;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getShift ()I
public final fun hashCode ()I
public final fun name ()Ljava/lang/String;
Expand All @@ -6937,7 +6937,7 @@ public final class dev/kord/common/entity/GuildMemberFlag$BypassesVerification :
public final class dev/kord/common/entity/GuildMemberFlag$Companion {
public final fun fromShift (I)Ldev/kord/common/entity/GuildMemberFlag;
public final fun getEntries ()Ljava/util/List;
public fun getEntries ()Lkotlin/enums/EnumEntries;
public synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/GuildMemberFlag;
public fun values ()[Ldev/kord/common/entity/GuildMemberFlag;
Expand Down Expand Up @@ -7500,7 +7500,7 @@ public abstract class dev/kord/common/entity/MessageFlag {
public final fun equals (Ljava/lang/Object;)Z
public final fun getCode ()I
public final fun getDeclaringClass ()Ljava/lang/Class;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getShift ()I
public final fun hashCode ()I
public final fun name ()Ljava/lang/String;
Expand All @@ -7515,7 +7515,7 @@ public abstract class dev/kord/common/entity/MessageFlag {
public final class dev/kord/common/entity/MessageFlag$Companion {
public final fun fromShift (I)Ldev/kord/common/entity/MessageFlag;
public final fun getEntries ()Ljava/util/List;
public fun getEntries ()Lkotlin/enums/EnumEntries;
public synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/MessageFlag;
public fun values ()[Ldev/kord/common/entity/MessageFlag;
}
Expand Down Expand Up @@ -8114,10 +8114,6 @@ public final class dev/kord/common/entity/Permission$ManageChannels : dev/kord/c
public static final field INSTANCE Ldev/kord/common/entity/Permission$ManageChannels;
}

public final class dev/kord/common/entity/Permission$ManageEmojisAndStickers : dev/kord/common/entity/Permission {
public static final field INSTANCE Ldev/kord/common/entity/Permission$ManageEmojisAndStickers;
}

public final class dev/kord/common/entity/Permission$ManageEvents : dev/kord/common/entity/Permission {
public static final field INSTANCE Ldev/kord/common/entity/Permission$ManageEvents;
}
Expand Down Expand Up @@ -8736,7 +8732,7 @@ public abstract class dev/kord/common/entity/SystemChannelFlag {
public final fun equals (Ljava/lang/Object;)Z
public final fun getCode ()I
public final fun getDeclaringClass ()Ljava/lang/Class;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getShift ()I
public final fun hashCode ()I
public final fun name ()Ljava/lang/String;
Expand All @@ -8751,7 +8747,7 @@ public abstract class dev/kord/common/entity/SystemChannelFlag {
public final class dev/kord/common/entity/SystemChannelFlag$Companion {
public final fun fromShift (I)Ldev/kord/common/entity/SystemChannelFlag;
public final fun getEntries ()Ljava/util/List;
public fun getEntries ()Lkotlin/enums/EnumEntries;
public synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/SystemChannelFlag;
public fun values ()[Ldev/kord/common/entity/SystemChannelFlag;
}
Expand Down Expand Up @@ -8943,7 +8939,7 @@ public abstract class dev/kord/common/entity/UserFlag {
public final fun equals (Ljava/lang/Object;)Z
public final fun getCode ()I
public final fun getDeclaringClass ()Ljava/lang/Class;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getShift ()I
public final fun hashCode ()I
public final fun name ()Ljava/lang/String;
Expand Down Expand Up @@ -8974,7 +8970,7 @@ public final class dev/kord/common/entity/UserFlag$BugHunterLevel2 : dev/kord/co
public final class dev/kord/common/entity/UserFlag$Companion {
public final fun fromShift (I)Ldev/kord/common/entity/UserFlag;
public final fun getEntries ()Ljava/util/List;
public fun getEntries ()Lkotlin/enums/EnumEntries;
public synthetic fun getEntries ()Lkotlin/enums/EnumEntries;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/UserFlag;
public fun values ()[Ldev/kord/common/entity/UserFlag;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public sealed class ActivityType(
unused: Nothing?,
) : ActivityType(code) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +44,7 @@ public sealed class AllowedMentionType(
unused: Nothing?,
) : AllowedMentionType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +45,7 @@ public sealed class ApplicationCommandOptionType(
unused: Nothing?,
) : ApplicationCommandOptionType(type) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +45,7 @@ public sealed class ApplicationCommandPermissionType(
unused: Nothing?,
) : ApplicationCommandPermissionType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +44,7 @@ public sealed class ApplicationCommandType(
unused: Nothing?,
) : ApplicationCommandType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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 @@ -69,16 +69,20 @@ public sealed class ApplicationFlag(
* @suppress
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(message =
"ApplicationFlag is no longer an enum class. Deprecated without a replacement.")
@Deprecated(
level = DeprecationLevel.ERROR,
message = "ApplicationFlag is no longer an enum class. Deprecated without a replacement.",
)
public fun name(): String = this::class.simpleName!!

/**
* @suppress
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(message =
"ApplicationFlag is no longer an enum class. Deprecated without a replacement.")
@Deprecated(
level = DeprecationLevel.ERROR,
message = "ApplicationFlag is no longer an enum class. Deprecated without a replacement.",
)
public fun ordinal(): Int = when (this) {
ApplicationAutoModerationRuleCreateBadge -> 0
GatewayPresence -> 1
Expand All @@ -97,6 +101,7 @@ public sealed class ApplicationFlag(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
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 @@ -289,8 +294,11 @@ public sealed class ApplicationFlag(
* @suppress
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith"))
@Deprecated(message =
"ApplicationFlag is no longer an enum class. Deprecated without a replacement.")
@Deprecated(
level = DeprecationLevel.ERROR,
message =
"ApplicationFlag is no longer an enum class. Deprecated without a replacement.",
)
@JvmStatic
public open fun valueOf(name: String): ApplicationFlag = when (name) {
"ApplicationAutoModerationRuleCreateBadge" -> ApplicationAutoModerationRuleCreateBadge
Expand All @@ -311,6 +319,7 @@ public sealed class ApplicationFlag(
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT"))
@Deprecated(
level = DeprecationLevel.ERROR,
message = "ApplicationFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ApplicationFlag.entries.toTypedArray()", imports
= arrayOf("dev.kord.common.entity.ApplicationFlag")),
Expand All @@ -323,7 +332,7 @@ public sealed class ApplicationFlag(
*/
@Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED"))
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message = "ApplicationFlag is no longer an enum class.",
replaceWith = ReplaceWith(expression = "ApplicationFlag.entries", imports =
arrayOf("dev.kord.common.entity.ApplicationFlag")),
Expand Down Expand Up @@ -433,6 +442,7 @@ public class ApplicationFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'values'.",
replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()),
)
Expand Down Expand Up @@ -498,6 +508,7 @@ public class ApplicationFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "ApplicationFlags is no longer a data class.",
replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()),
)
Expand All @@ -507,8 +518,10 @@ public class ApplicationFlags internal constructor(
* @suppress
*/
@Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith"))
@Deprecated(message =
"ApplicationFlags is no longer a data class. Deprecated without a replacement.")
@Deprecated(
level = DeprecationLevel.ERROR,
message = "ApplicationFlags is no longer a data class. Deprecated without a replacement.",
)
public fun copy(code: Int = this.code): ApplicationFlags = ApplicationFlags(code)

public class Builder(
Expand Down Expand Up @@ -552,6 +565,7 @@ public class ApplicationFlags internal constructor(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +50,7 @@ public sealed class ApplicationRoleConnectionMetadataType(
unused: Nothing?,
) : ApplicationRoleConnectionMetadataType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +44,7 @@ public sealed class AuditLogEvent(
unused: Nothing?,
) : AuditLogEvent(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +47,7 @@ public sealed class AutoModerationActionType(
unused: Nothing?,
) : AutoModerationActionType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +47,7 @@ public sealed class AutoModerationRuleEventType(
unused: Nothing?,
) : AutoModerationRuleEventType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +47,7 @@ public sealed class AutoModerationRuleKeywordPresetType(
unused: Nothing?,
) : AutoModerationRuleKeywordPresetType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +47,7 @@ public sealed class AutoModerationRuleTriggerType(
unused: Nothing?,
) : AutoModerationRuleTriggerType(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
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,6 +45,7 @@ public sealed class ButtonStyle(
unused: Nothing?,
) : ButtonStyle(value) {
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Replaced by 'ButtonStyle.from()'.",
replaceWith = ReplaceWith(expression = "ButtonStyle.from(value)", imports =
arrayOf("dev.kord.common.entity.ButtonStyle")),
Expand Down
Loading

0 comments on commit f2fe43e

Please sign in to comment.