25 Commits

Author SHA1 Message Date
Alyssa Haroldsen
5c8c44041a Add support for TOML configuration files
This is used in many contexts, including being the format used by
Cargo, the Rust package manager.
2023-04-11 19:14:34 -07:00
Xuehai Pan
66bad5e563 fix: fix extra spacing in Apache License template 2023-01-18 13:42:46 +08:00
Mike Verbanic
cfe103d3f1 update terraform to use hash as comment per recommended guidelines (#137)
* update terraform to use hash as comment per recommended guidelines (https://developer.hashicorp.com/terraform/language/syntax/configuration\#comments)

* update golanci-lint version in linter.yaml per PR #132
2023-01-16 09:07:57 -08:00
Will Norris
2fe3ee9447 fix: use block-style comments for java, scala, kotlin
fixes #46
2021-08-14 14:09:22 -07:00
CrazyMax
99ebc9c9db Update Dockerfile handling to keep parser directives at the top
Signed-off-by: CrazyMax <google@crazymax.dev>
2021-08-09 12:50:07 -07:00
CrazyMax
5be3beef79 Add hcl extension
Signed-off-by: CrazyMax <google@crazymax.dev>
2021-08-09 12:45:59 -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
Piotr Sikora
73f8d3e793 Skip .bzl files generated by cargo raze.
Broken by #45.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2020-08-18 07:36:45 +00:00
Marc Cohen
6f4cd4aacc Merge pull request #42 from tpryan/master
Adding support for SCSS and Sass files.
2020-08-17 06:19:35 +01:00
Marc Cohen
38d99b79c9 Merge pull request #43 from TomerAberbach/master
Support DOT files
2020-08-17 06:16:32 +01:00
Marc Cohen
144dc783ad Merge branch 'master' into master 2020-08-17 06:15:11 +01:00
Mark Fashing
82e1f9d7b8 Support Spanner schema and Skylark files.
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.
2020-07-28 14:15:54 -06:00
Tomer Aberbach
c4cb7c1b63 feat: support graphviz file extension 2020-07-04 00:10:47 -04:00
Terrence Ryan
e2ec6d07f7 Adding support for SCSS and Sass files. 2020-06-23 10:56:15 -07:00
Marc-Antoine Ruel
541722a254 Skip generated files
Ensure it skips for both check only mode and modification mode.

Fixes #39
2020-06-22 12:57:52 -04:00
Tomer Aberbach
3fa068400f feat: add tests for new .mjs and .cjs file extensions 2020-04-25 20:47:44 -04:00
alex
20ee99ff6a Update .php handling to keep <?php at the top
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.
2020-02-22 20:45:35 +01: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
Daniel Seymour
12f10136e4 Add support for several other file types
Adds support for Dockerfiles, Gemfiles, Ruby files, and Groovy files.
Also, in order to fully support Dockerfile and Gemfiles, a new file
extension parser was created to deal with files that do not have an
extension.
2018-12-19 15:56:43 -08:00
alex
f9cb8b9a1d Merge pull request #12 from google/xml-html
Better support for XML and HTML
2018-07-21 22:40:47 +02:00
alex
071b332aa8 Better support for XML and HTML
Keep <?xml and <!doctype declarations.
2018-07-21 16:57:39 +02: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
Morgante Pell
76852768cb Add support for Terraform files 2018-07-20 18:06:44 -04:00
alex
6631c269a8 initial import 2016-06-27 12:03:58 +01:00