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

ament_copyright --add-missing does not work with empty files cpp files. #514

Open
kscottz opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@kscottz
Copy link

kscottz commented Dec 19, 2024

I came across a small bug in ament_copyright. If you create an empty source file and then run ament_copyright --add-missing the program does not add any license information.

I am unsure if this behavior is intentional or if the behavior constitutes a bug. If it is the former we may want to document it.

Here is how to reproduce the bug

~/Code/src$ touch new_file.cpp
~/Code/src$ ament_copyright --verbose
new_file.cpp: file empty
test_position.cpp: copyright=Open Source Robotics Foundation, Inc. (2021), license=apache2
No problems found, checked 2 files
~/Code/src$ ament_copyright --add-missing KAT bsd2
~/Code/src$ ament_copyright --verbose
new_file.cpp: file empty
test_position.cpp: copyright=Open Source Robotics Foundation, Inc. (2021), license=apache2
No problems found, checked 2 files
~/Code/src$ emacs new_file.cpp < add void main{} >
~/Code/src$ ament_copyright --add-missing KAT bsd2
* new_file.cpp
~/Code/src$ ament_copyright --verbose
new_file.cpp: copyright=KAT (2024), license=bsd2
test_position.cpp: copyright=Open Source Robotics Foundation, Inc. (2021), license=apache2
No problems found, checked 2 files
~/Code/src$ 

Somewhat related the --list-licenses option is a bit vague. I read the help file information as "this option lists all licenses in the given directory." What the option does is provide a list of available licenses that can be added to unlicensed files. The help file should clarify what the option does a bit more clearly.

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

No branches or pull requests

1 participant