Add new rule to SwiftLint for linting newlines before return
statements
#47
Labels
enhancement
Issues that describe new features or improvements to existing features.
We should add a rule to SwiftLint via PR that allows linting newlines before a
return
statement.This cannot be linted using a regular expression with reasonable complexity and hence needs to be implemented in code. Once we implemented this we should send it as a PR to the main SwiftLint repo and see if they would like to add it. Hence we should think about configuration options, for which I propse the following:
allowPrecedingComments
: If set totrue
, a comment might precede areturn
statement without an empty line between them. In that case the comment must be preceded by a newline instead.true
by default.The rule should work similar to the one we already implemented for PHP.
The rule should be implemented using the AST provided by the new
SyntaxRule
.The text was updated successfully, but these errors were encountered: