Skip to content

Commit

Permalink
provide tools for rule
Browse files Browse the repository at this point in the history
  • Loading branch information
tangcent committed Feb 8, 2020
1 parent 78b6468 commit 9fa3ae2
Show file tree
Hide file tree
Showing 6 changed files with 1,112 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .easy.api.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# rule to export method doc
api.name=groovy:it.name()
mdoc.method.filter=groovy:!it.hasModifier("private")
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ fun String?.notEmpty(): Boolean {
fun String.headLine(): String? {
if (this.isBlank()) return null

val lines = this.lines()
return if (lines.size > 1) {//multi line
lines.firstOrNull { it.isNotBlank() }
} else {
this
}
val headLine = this.substringBefore("\r\n")
if (headLine.isBlank()) return ""
return headLine
}
Loading

0 comments on commit 9fa3ae2

Please sign in to comment.