Skip to content

Commit

Permalink
chore: don't perform checks like missing description on deprecated bl…
Browse files Browse the repository at this point in the history
…ocks

closes #57
  • Loading branch information
shreyashsaitwal committed Jan 11, 2024
1 parent 9e307e8 commit d3d34b6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/commands/create/templates/intellij_files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ $sources

const String ijLocalDepsXml = '''
<component name="libraryTable">
<library name="deps">
<library name="local-deps">
<CLASSES>
<root url="file://\$PROJECT_DIR\$/deps" />
</CLASSES>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -66,7 +66,7 @@ class Function(
if (typeArgs.isEmpty()) {
messager.printMessage(
Kind.ERROR,
"Continuation parameter must be specialized with a type, like `Continuation<Boolean>`.",
"Continuation parameter must be specialized with a type, for e.g. `Continuation<Boolean>`.",
element
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d3d34b6

Please sign in to comment.