15 Commits

Author SHA1 Message Date
aleksandr.vodyanov
bc2ae7b9b2 add new extensions 2024-05-13 18:29:10 +03:00
Stanislav Gabenov
65deee00fd [DO-169] Modify to add template with Avroid license 2024-04-10 14:47:27 +03:00
Xuehai Pan
66bad5e563 fix: fix extra spacing in Apache License template 2023-01-18 13:42:46 +08:00
Anuraag Agrawal
04bfe4ee9c Don't render extra space when year is not set 2022-08-26 08:00:37 -07:00
Will Norris
b431030b15 use text/template to avoid HTML escaping
Co-authored-by: Roy O'Young <roy2220@outlook.com>

Closes #57
2021-08-09 11:36:20 -07:00
Will Norris
792e7a3462 migrate CI to GitHub Actions
use codecov.io to report on code coverage.
fix a few issues raised by golangci-lint
2021-07-27 22:11:04 -07:00
Will Norris
97ae522f98 add support for SPDX license headers
This adds a new "-s" flag that will append an SPDX-License-Identifier
line to license headers.  If "-s=only" is specified, then only the SPDX
identifier will be used.

This also changes the "-l" flag to use SPDX identifiers, with mappings
to support the legacy "apache", "mit", and "mpl" values.  Together with
the "-s" flag, this allows SPDX headers for any arbitrary license type
to be added to files.

Co-authored-by: Bob Callaway <bcallawa@redhat.com>
2021-07-26 20:43:15 -07:00
Will Norris
c2fdf83882 refactor template parsing logic
Move the logic for selecting a license template based on user input into
a standalone func (fetchTemplate), and add test cases for all code
paths.

Delay parsing predefined license templates. This allows the new
fetchTemplate method to modify these templates before returning in the
future (to add SPDX license information).  Add tests to ensure that
these templates must always parse properly.

Rename copyrightData type to licenseData, since we will soon begin to
add more than just copyright data here (SPDX ID).

Rename prefix func to executeTemplate, since this better describes what
the function is doing.

These are all refactoring and cleanup changes; no behavioral changes.
2021-07-26 19:38:13 -07:00
Tim Clifford
fb22319bcc add support for MPL license 2020-04-14 21:20:33 +02:00
alex
f6c8b89ee5 Switch year arg from int to string
This effectively allows for arbitrary copyright
years. For instance, 2018-2019.
2019-01-07 14:10:08 +01:00
Daniel Seymour
66fdaacba5 Update test data licenses to use the current year and copyright holder 2018-12-19 15:59:35 -08:00
Brad Rydzewski
c63d25f5fc custom license from file 2018-11-30 10:55:22 -06:00
alex
6f621186c8 Trim trailing whitespace
If a license text had blank lines, they would result in a trailing
whitespace when prefixed with the line comments.

This change removes trailing whitespace from the middle lines,
leaving top and bottom as is.

Fixes #10
2018-07-21 16:24:29 +02:00
Brad Rydzewski
40c31bd566 added bsd license header 2017-12-07 15:36:14 -08:00
alex
6631c269a8 initial import 2016-06-27 12:03:58 +01:00