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

Addon pipeline for source string collection #1160

Merged
merged 8 commits into from
Apr 10, 2024

Conversation

keshav-space
Copy link
Member

@keshav-space keshav-space commented Apr 9, 2024

Addon pipeline to collect the source strings from code file using xgettext and store it in extra_data field.

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
them in the extra data field.
"""
result = strings_xgettext.collect_strings(resource.location)
strings = [item["string"] for item in result if "string" in item]
Copy link
Member

Choose a reason for hiding this comment

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

In the future we may want to track line numbers too.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Looking good... there are a few nits but you can ignore them... Please merge!

keshav-space and others added 3 commits April 10, 2024 17:30
Signed-off-by: Keshav Priyadarshi <git@keshav.space>

Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>

Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
@keshav-space keshav-space merged commit 1af8d99 into main Apr 10, 2024
9 checks passed
@keshav-space keshav-space deleted the 1108-collect-source-strings branch April 10, 2024 12:20
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.

ScanCode.io: Support multiple tools adding gettext for strings
2 participants