-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle trailing newline in macro definitions #361
Conversation
Build succeeded. ✔️ pre-commit SUCCESS in 2m 18s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
However, I believe this is also a parsing issue. The ending newline character should be part of the body, not included in _whitespace
. To make that right, the regex here should be replaced with ([^\S\n]+)$
(not to match \n
characters):
specfile/specfile/macro_definitions.py
Line 386 in a14e688
tokens = re.split(r"(\s+)$", body, maxsplit=1) |
If you are fine with it, I will merge the PR as it is and fix the parsing myself afterwards.
Thanks! Would you also add that case to
Good point, but I don't think it matters here, empty lines don't have to be excluded because they can't possibly contain a start of a section. But feel free to replace |
Fixes #360 Signed-off-by: Nikita Gerasimov <[email protected]>
for more information, see https://pre-commit.ci
Build succeeded. ✔️ pre-commit SUCCESS in 2m 12s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 2m 49s |
6fc5bee
into
packit:main
Fixes #360.