* Added .pl to the list of supported files
Includes support for Perl (.pl) file, treated in the same way as shell scripts.
* Adding .pl to the relevant test case
use the doublestar library to support pattern matching of files or
directories to ignore. This replaces (and deprecates) the previous
-skip flag which only supported file extensions.
Much of this is being tested with the existing file-based tests in
testdata/*, but this moves us toward a much more targetted and simpler
test structure.
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>
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.
Adds support for the .sdl file extension which is used for Spanner's
Schema Definition Language. It uses -- for comments in the manner of
.sql files.
Adds support for the .bzl file extension which is used for Bazel's
Starlark language. It uses # for comments in the manner of Python.
Looking at https://www.php.net/manual/en/language.basic-syntax.phptags.php
there are just too many variations and I'm not convinced the added
complexity to support all of them would be worth it here.
Thus, support only the case where closing tag "?>" is either omitted
or on a separate line. A workaround for all other cases is to add
the license header manually.
Can always revisit this later.