-
Notifications
You must be signed in to change notification settings - Fork 7
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
Track lines when parsing copyright files #13
Comments
I have started to work on this as the lack of proper start and end line in Debian copyright license detection makes reviewing test failures rather hard. I searched for a library that track line numbers and could not find any. And none seems really suitable to patch and add line numbers. So my overall approach is going to be:
|
pombredanne
added a commit
that referenced
this issue
Sep 7, 2021
This adds support for tracking line number when processing copyright files. The approach is to only support this for copyright files and keep a mapping of start/end line numbers by field name at the paragraph level. This way existing fields do not need modifications and the core code update is when paragraphs are created which is limited to a single place. There is also a new deb822 module replacing the email parser to parse copyright files keep track of line numbers. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne
added a commit
that referenced
this issue
Sep 14, 2021
Track line numbers in copyright files #13 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne
added a commit
to aboutcode-org/scancode-toolkit
that referenced
this issue
Sep 14, 2021
This allows to pass a string which we known starts at some line offset. This is useful for Debian copyright parsing for instance See: #2643 See: aboutcode-org/debian-inspector#13 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne
added a commit
to aboutcode-org/scancode-toolkit
that referenced
this issue
Sep 14, 2021
Add new licensing.get_license_matches_from_query_string() function that accepts a text and a start line (defaulting at 1). This is used to build a Query which is then passed to the new Index.match_query() method. See: #2643 See: aboutcode-org/debian-inspector#13 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This has been implemented and released |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would be helpful when reviewing results
The text was updated successfully, but these errors were encountered: