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

Fix bug, allows using ament_copyright with bsd3 #206

Merged
merged 3 commits into from
Jan 30, 2020

Conversation

Blast545
Copy link
Contributor

To reproduce this bug you have to use the ament_copyright tool to try adding missing headers to a file, using the bsd2 license. After sourcing the ROS workspace:

ament_copyright --add-missing 'osrf' bsd2 src/ament/ament_lint/ament_copyright/test/cases/bsd_license/case.py

This will cause
KeyError: 'copyright_holder'

Format of the bsd2 license expected a command to pass a 'copyright_holder' key as a parameter to include in the license. However, the current CLI does not includes this. This quick fix uses as copyright holder this: 'the copyright holder', so the text match the condition as expressed in: https://opensource.org/licenses/BSD-3-Clause

Later on it could be discussed if it's a desirable solution to include adding this copyright holder variable in the cli.

In the bs2 headers, exists a "{copyright_holder}" text that causes a problem
when using the command ament_copyright to add headers to a source file.

This fix adds a default value for that key, to match the original 3-Clause BSD
text, and allowing to use the tool.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
@Blast545 Blast545 self-assigned this Jan 29, 2020
@Blast545 Blast545 added the bug Something isn't working label Jan 29, 2020
Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
@Blast545
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@Blast545 Blast545 merged commit a21a924 into master Jan 30, 2020
@delete-merged-branch delete-merged-branch bot deleted the blast545/bug_copyright_holder branch January 30, 2020 17:46
@dirk-thomas
Copy link
Contributor

Based on https://answers.ros.org/question/353760/ament_copyright-add-missing-gives-keyerror-copyright_holder/ this should probably be backported to Eloquent. @mjcarroll Can you please do that (and check if it is also needed for Dashing)?

mjcarroll pushed a commit that referenced this pull request Jun 18, 2020
* Fix bug, allows using ament_copyright with bsd3

In the bs2 headers, exists a "{copyright_holder}" text that causes a problem
when using the command ament_copyright to add headers to a source file.

This fix adds a default value for that key, to match the original 3-Clause BSD
text, and allowing to use the tool.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>

* Add copyright_name if template includes copyright_holder reference

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>

* Revert comma addition

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
mjcarroll pushed a commit that referenced this pull request Jun 18, 2020
In the bs2 headers, exists a "{copyright_holder}" text that causes a problem
when using the command ament_copyright to add headers to a source file.

This fix adds a default value for that key, to match the original 3-Clause BSD
text, and allowing to use the tool.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
mjcarroll pushed a commit that referenced this pull request Jun 18, 2020
In the bs2 headers, exists a "{copyright_holder}" text that causes a problem
when using the command ament_copyright to add headers to a source file.

This fix adds a default value for that key, to match the original 3-Clause BSD
text, and allowing to use the tool.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
mjcarroll pushed a commit that referenced this pull request Jun 18, 2020
Backport of #206 for Dashing

Fix bug, allows using ament_copyright with bsd3

In the bs2 headers, exists a "{copyright_holder}" text that causes a problem
when using the command ament_copyright to add headers to a source file.

This fix adds a default value for that key, to match the original 3-Clause BSD
text, and allowing to use the tool.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
mjcarroll added a commit that referenced this pull request Jun 26, 2020
Backport of #206 for Dashing

Fix bug, allows using ament_copyright with bsd3

In the bs2 headers, exists a "{copyright_holder}" text that causes a problem
when using the command ament_copyright to add headers to a source file.

This fix adds a default value for that key, to match the original 3-Clause BSD
text, and allowing to use the tool.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
Signed-off-by: Michael Carroll <michael@openrobotics.org>

Co-authored-by: Jorge Perez <j.j.perez13@hotmail.com>
mjcarroll added a commit that referenced this pull request Jun 26, 2020
In the bs2 headers, exists a "{copyright_holder}" text that causes a problem
when using the command ament_copyright to add headers to a source file.

This fix adds a default value for that key, to match the original 3-Clause BSD
text, and allowing to use the tool.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
Signed-off-by: Michael Carroll <michael@openrobotics.org>

Co-authored-by: Jorge Perez <j.j.perez13@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants