packit / specfile

A library for parsing and manipulating RPM spec files
MIT License
24 stars 15 forks source link

Handle trailing newline in macro definitions #361

Closed nikitych closed 7 months ago

nikitych commented 7 months ago

Fixes #360.

softwarefactory-project-zuul[bot] commented 7 months ago

Build succeeded. https://softwarefactory-project.io/zuul/t/packit-service/buildset/51088f7327484e5eba82fd07213c3e14

:heavy_check_mark: pre-commit SUCCESS in 2m 18s :heavy_check_mark: specfile-tests-rpm-deps SUCCESS in 1m 11s :heavy_check_mark: specfile-tests-pip-deps SUCCESS in 1m 04s

nikitych commented 7 months ago

I'll rewrite PR to add \n to the body.

There are also a couple of technically errors of missing \n here and here. I spent some time but could not figure out how to exploit the non-excluded empty string. So I could fix them as well, but without adding tests.

nforro commented 7 months ago

I'll rewrite PR to add \n to the body.

Thanks! Would you also add that case to test_parse?

There are also a couple of technically errors of missing \n here and here. I spent some time but could not figure out how to exploit the non-excluded empty string. So I could fix them as well, but without adding tests.

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 splitlines() with split("\n") (is that the fix you had in mind?).

softwarefactory-project-zuul[bot] commented 7 months ago

Build succeeded. https://softwarefactory-project.io/zuul/t/packit-service/buildset/0a7d01d5fbfd4657b9fc137779544627

:heavy_check_mark: pre-commit SUCCESS in 2m 12s :heavy_check_mark: specfile-tests-rpm-deps SUCCESS in 1m 11s :heavy_check_mark: specfile-tests-pip-deps SUCCESS in 1m 09s

softwarefactory-project-zuul[bot] commented 7 months ago

Build succeeded (gate pipeline). https://softwarefactory-project.io/zuul/t/packit-service/buildset/d0cdcd11874b479c99ce699a72857e9a

:heavy_check_mark: pre-commit SUCCESS in 2m 49s