i get the error `Lint error > [standard:function-n...
# ktlint
c
i get the error
Lint error > [standard:function-naming] Function name should start with a lowercase letter (except factory methods) and use camel case
and I wonder how does ktlint detect factory methods?
p
See code how it is determined. The approach is a bit simplistic and might miss certain cases. But basically the name of the method should be equal to the return type.
c
oh ok so it works only when the result value is explicitly declared, I guess there is no simple way to determine that the only call in a method is a constructor call?
p
ktlint has no semantic knowledge. It can only use the AST of the file which is being processed. But also within that file, it does not lookup other elements for cross checking.
235 Views