Skip to content
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

[issue-299] allow single line of text in free form text #300

Merged
merged 5 commits into from
Nov 22, 2022

Conversation

meretp
Copy link
Collaborator

@meretp meretp commented Nov 16, 2022

fixes #299

Signed-off-by: Meret Behrens meret.behrens@tngtech.com

@meretp meretp changed the title allow single line of text in free form text WIP allow single line of text in free form text Nov 16, 2022
@meretp
Copy link
Collaborator Author

meretp commented Nov 16, 2022

Todo: adapt docstrings

@meretp meretp changed the title WIP allow single line of text in free form text WIP: [issue-299] allow single line of text in free form text Nov 17, 2022
@meretp meretp changed the title WIP: [issue-299] allow single line of text in free form text [issue-299] allow single line of text in free form text Nov 17, 2022
@meretp
Copy link
Collaborator Author

meretp commented Nov 17, 2022

Todo: adapt docstrings

Done, ready for review

nicoweidner
nicoweidner previously approved these changes Nov 21, 2022
Copy link
Collaborator

@nicoweidner nicoweidner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I only noticed 2 typos that we may as well fix

@@ -16,7 +16,7 @@ PackageVerificationCode: SOME code
PackageLicenseDeclared: NOASSERTION
PackageLicenseConcluded: NOASSERTION
PackageLicenseInfoFromFiles: LGPL-2.1-or-later
PackageCopyrightText: <text>Some copyrught</text>
PackageCopyrightText: Some copyrught
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you touch this line, you might as well fix the typo 😛

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are actually 14 occurences of copyrught in the project :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, it was once fixed in a PR, but probably reverted during some merge conflicts or whatever, but I will change this now, it really bothers my inner Monk (not sure if this is the correct translation)..

@@ -16,7 +16,7 @@ PackageVerificationCode: SOME code
PackageLicenseDeclared: NOASSERTION
PackageLicenseConcluded: NOASSERTION
PackageLicenseInfoFromFiles: LGPL-2.1-only
PackageCopyrightText: <text>Some copyrught</text>
PackageCopyrightText: Some copyrught
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines +1304 to +1310
def p_text_or_line_value_1(self, p):
"""text_or_line : TEXT"""
p[0] = p[1]

def p_text_or_line_value_2(self, p):
"""text_or_line : LINE"""
p[0] = p[1]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks absurd, but seems to be doing the right thing!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the tag-value lexer, a TEXT is a string (possibly multi-line) enclosed in <text>, while LINE is a single line without the tags. Some properties don't allow TEXT, so there has to be a distinction.

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
…d validate_is_free_form_text_or_str

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
@meretp meretp force-pushed the single_line_of_test_in_free_form_text branch from 0b3abc0 to 7513c39 Compare November 22, 2022 09:41
@meretp meretp merged commit 4b7ae25 into spdx:main Nov 22, 2022
@meretp meretp deleted the single_line_of_test_in_free_form_text branch November 22, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow single lines during parsing of text values in tag-value format
3 participants