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

Track line numbers in copyright files #13 #22

Merged
merged 42 commits into from
Sep 14, 2021
Merged

Conversation

pombredanne
Copy link
Member

This PR adds tracking of line numbers in Debian copyright files for #13
This is to support license line number reporting in
aboutcode-org/scancode-toolkit#2643

It also adds a few extra minor updates:

  • remove deprecated debut module
  • various minor refactoring, doc updates and cleanups

pombredanne and others added 30 commits May 31, 2021 11:24
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
From aboutcode-org/typecode#20

Reported-by: Pierre Tardy <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
And remove v prefix from fallback version

Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
 * This is handy for windows to have the same path as linux

Signed-off-by: Chin Yeung Li <[email protected]>
Create junction from Scripts to bin
Check for deps in local thirdparty directory #31
    * Create copyright statement from holder information

Signed-off-by: Jono Yang <[email protected]>
    * This is used for the case where we are starting off a project and have not yet generated requirements files

Signed-off-by: Jono Yang <[email protected]>
Signed-off-by: Jono Yang <[email protected]>
    * Replace all references to `tmp` with `venv`

Signed-off-by: Jono Yang <[email protected]>
    * Add --init option to configure.bat
    * Update help text in configure and configure.bat

Signed-off-by: Jono Yang <[email protected]>
    * Update README.rst

Signed-off-by: Jono Yang <[email protected]>
    * Update README.rst with instructions for post-initialization usage

Signed-off-by: Jono Yang <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
This was not used anywhere.
Also make minor updates to docstrings.

Signed-off-by: Philippe Ombredanne <[email protected]>
This was an unused duplicate of:
debian_inspector.copyright.CatchAllParagraph

Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
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 <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
pombredanne and others added 12 commits September 7, 2021 19:42
Signed-off-by: Philippe Ombredanne <[email protected]>
    * Replace references to scancode-toolkit repo with links to the skeleton repo

    * Remove --python option from configure.bat

Signed-off-by: Jono Yang <[email protected]>
Signed-off-by: Jono Yang <[email protected]>
Add README.rst to etc/scripts/
This is allowed in deb822 and also in copyright processing.
There a duplicated field will be made unique by renaming it by adding
a suffix with an incremented number.

Also add Paragraph get_field_line_numbers() methods

Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
When a field first line (the line with the field name) was empty, we
were

Signed-off-by: Philippe Ombredanne <[email protected]>
- Rename ParagraphMixin to BaseParagraph
- Restore from_dict() method
- use fields rather than header fields as name
- improve and fix merging of contiguous paragraphs
- Recover parsing some mostly valid dep5-like copyright files

Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
@pombredanne
Copy link
Member Author

This is now all green and working fine in SCTK.
Merging!

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.

3 participants