RussellSpitzer opened a new pull request, #15422:
URL: https://github.com/apache/iceberg/pull/15422
Uses the following Regex to find violations
(?m)(^[ \t]*\}[ \t]*\n)(?![ \t]*\n)(?![ \t]*\})(?![ \t]*\z)
-----------------------====================================
------------- Match Section ----------------
(?m) — Multiline mode. Makes ^ match the start of every line, not just the
start of the file.
( — Opens capture group $1 (used by the spotless replacement).
^[ \t]*\} — Match any amount of white space ending in a brace character.
Excludes Javadoc (* {@link Foo}), comments (// something}), and inline
expressions (new String[] {...}).
[ \t]*\n — Match optional trailing whitespace after }, then the newline
ending that line.
) — Closes capture group $1. Everything above is "the closing brace line".
============= Look Ahead Section ====================
The three negative lookaheads check what comes next:
(?![ \t]*\n) — The next line is NOT all white-space. If there's already a
blank line, the rule is already satisfied — don't flag it or add another. (?![
\t]*\}) — The next line must NOT start with another }. Consecutive closing
braces (like the end of nested blocks) don't need blank lines between them.
(?![ \t]*\z) — The next line is NOT EOF. Don't flag or insert a trailing blank
line at the end of a file.
Used Cursor extensively for Regex testing and reviewing the existing
codebase to determine exactly what we needed to fix the current setup.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]