LuciferYang edited a comment on pull request #30255: URL: https://github.com/apache/spark/pull/30255#issuecomment-722966349
https://github.com/scalastyle/scalastyle/blob/ec14399543d2d5ccf93c3713aa5df21793844791/src/main/scala/org/scalastyle/scalariform/ProcedureDeclarationChecker.scala#L17-L35 ``` package org.scalastyle.scalariform import scalariform.lexer.Tokens class ProcedureDeclarationChecker extends AbstractSingleMethodChecker[Unit] { val errorKey = "procedure.declaration" protected def matchParameters() = Unit protected def matches(t: FullDefOrDclVisit, p: Unit) = { (t.funDefOrDcl.nameToken.text != "this") && (t.funDefOrDcl.funBodyOpt match { // match if we don't have a body, and there is no return type case None => t.funDefOrDcl.returnTypeOpt.isEmpty // match if we do have a body, and the first character is not equals case Some(x) => x.tokens.nonEmpty && x.tokens.head.tokenType != Tokens.EQUALS case _ => false }) } } ```  I think `ProcedureDeclarationChecker` can help us to discover new compilation warnings about `procedure syntax is deprecated`, but it can't check constructor methods now ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
