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

Bsd2 license #73

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion ament_copyright/ament_copyright/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def search_copyright_information(content):
year = '\d{4}'
year_range = '%s-%s' % (year, year)
year_or_year_range = '(?:%s|%s)' % (year, year_range)
pattern = '^[^\n\r]?\s*Copyright\s+(%s(?:,\s*%s)*)\s+([^\n\r]+)$' % \
pattern = '^[^\n\r]?\s*Copyright(?:\s+\(c\))?\s+(%s(?:,\s*%s)*),?\s+([^\n\r]+)$' % \
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have to support this case or could we update the code using that.

Copy link
Contributor Author

@clalancette clalancette Apr 26, 2017

Choose a reason for hiding this comment

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

So, this regex change is to allow a (c) after the word "Copyright". While we could change the code that has this, the BSD license recommends this format:

Copyright (c) <year>, <rights-holder>

(https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22BSD_License_2.0.22.2C_.22Revised_BSD_License.22.2C_.22New_BSD_License.22.2C_or_.22Modified_BSD_License.22.29).
Thus, any BSD code we come across is likely to be in that format, so I thought it would be better to support that.

(year_or_year_range, year_or_year_range)
regex = re.compile(pattern, re.DOTALL | re.MULTILINE)

Expand Down