From d3d34b6dc72d721fa2ccaad77db95c862a6d1766 Mon Sep 17 00:00:00 2001 From: Shreyash Saitwal <40118018+shreyashsaitwal@users.noreply.github.com> Date: Thu, 28 Dec 2023 19:35:06 +0530 Subject: [PATCH] chore: don't perform checks like missing description on deprecated blocks closes #57 --- lib/src/commands/create/templates/intellij_files.dart | 2 +- .../kotlin/io/github/shreyashsaitwal/rush/block/Block.kt | 2 +- .../kotlin/io/github/shreyashsaitwal/rush/block/Event.kt | 2 +- .../kotlin/io/github/shreyashsaitwal/rush/block/Function.kt | 6 +++--- .../kotlin/io/github/shreyashsaitwal/rush/block/Property.kt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/src/commands/create/templates/intellij_files.dart b/lib/src/commands/create/templates/intellij_files.dart index 8337d64..6791669 100644 --- a/lib/src/commands/create/templates/intellij_files.dart +++ b/lib/src/commands/create/templates/intellij_files.dart @@ -68,7 +68,7 @@ $sources const String ijLocalDepsXml = ''' - + diff --git a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Block.kt b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Block.kt index 61ea39a..f94f555 100644 --- a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Block.kt +++ b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Block.kt @@ -49,7 +49,7 @@ abstract class Block(val element: ExecutableElement, val messager: Messager, val open fun runChecks() { val type = this::class.java.simpleName.toString() - if (!Utils.isPascalCase(name)) { + if (!Utils.isPascalCase(name) && !deprecated) { messager.printMessage( Diagnostic.Kind.WARNING, "$type should follow `PascalCase` naming convention.", diff --git a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Event.kt b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Event.kt index c8e3aaf..e8e82c7 100644 --- a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Event.kt +++ b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Event.kt @@ -43,7 +43,7 @@ class Event( override fun runChecks() { super.runChecks() - if (description.isBlank()) { + if (description.isBlank() && !deprecated) { messager.printMessage(Kind.WARNING, "Event has no description.", element) } } diff --git a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Function.kt b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Function.kt index 30c9e39..49449b1 100644 --- a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Function.kt +++ b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Function.kt @@ -51,12 +51,12 @@ class Function( override fun runChecks() { super.runChecks() - if (description.isBlank()) { + if (description.isBlank() && !deprecated) { messager.printMessage(Kind.WARNING, "Function has no description.", element) } val continuations = params.filter { it.type == "continuation" } - if (continuations.size > 1) { + if (continuations.size > 1 && !deprecated) { messager.printMessage( Kind.WARNING, "Function should not have more than one continuation parameter.", element ) @@ -66,7 +66,7 @@ class Function( if (typeArgs.isEmpty()) { messager.printMessage( Kind.ERROR, - "Continuation parameter must be specialized with a type, like `Continuation`.", + "Continuation parameter must be specialized with a type, for e.g. `Continuation`.", element ) } diff --git a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Property.kt b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Property.kt index 4940bf8..88efdb2 100644 --- a/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Property.kt +++ b/processor/processor/src/main/kotlin/io/github/shreyashsaitwal/rush/block/Property.kt @@ -36,7 +36,7 @@ class Property( override fun runChecks() { super.runChecks() - if (description.isBlank()) { + if (description.isBlank() && !deprecated) { messager.printMessage(Kind.WARNING, "Property has no description.", element) }