mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#626 Remove blank lines before closing brackets
This commit is contained in:
parent
2c2f69b0d3
commit
71f4a4b2ca
@ -301,6 +301,9 @@ class IndentationCorrectingWriter extends Writer {
|
||||
context.indentationLevel++;
|
||||
return START_OF_LINE;
|
||||
case '}':
|
||||
if ( context.consecutiveLineBreaks > 0 ) {
|
||||
context.consecutiveLineBreaks = 0; // remove previous blank lines
|
||||
}
|
||||
case ')':
|
||||
context.indentationLevel--;
|
||||
return START_OF_LINE;
|
||||
|
@ -43,6 +43,10 @@
|
||||
<property name="format" value="(\r\n\r\n\r\n|\r\r\r|\n\n\n)" />
|
||||
<property name="message" value="There are multiple blank lines" />
|
||||
</module>
|
||||
<module name="RegexpMultiline">
|
||||
<property name="format" value="(\r\n\r\n\ *\}|\r\r *\}|\n\n *\})" />
|
||||
<property name="message" value="There are blank lines before a closing bracket" />
|
||||
</module>
|
||||
|
||||
<module name="RegexpSingleline">
|
||||
<!-- \s matches whitespace character, $ matches end of line. -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user