Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
".awk",
".buckconfig", "buck",
".bzl", ".bazel", "build", ".build",
".core",
".dockerfile", "dockerfile",
".ex", ".exs",
".fpp",
Expand Down Expand Up @@ -395,6 +396,7 @@ var head = []string{
"<?php", // PHP opening tag
"# escape", // Dockerfile directive https://docs.docker.com/engine/reference/builder/#parser-directives
"# syntax", // Dockerfile directive https://docs.docker.com/engine/reference/builder/#parser-directives
"capi=", // FuseSoC .core files
}

func hashBang(b []byte) []byte {
Expand Down
2 changes: 2 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ func TestAddLicense(t *testing.T) {
{"<?php\ncontent", "<?php\n// HYS\n\ncontent", true},
{"# escape: `\ncontent", "# escape: `\n// HYS\n\ncontent", true},
{"# syntax: docker/dockerfile:1.3\ncontent", "# syntax: docker/dockerfile:1.3\n// HYS\n\ncontent", true},
{"CAPI=2:\ncontent", "CAPI=2:\n// HYS\n\ncontent", true},

// ensure files with existing license or generated files are
// skipped. No need to test all permutations of these, since
Expand Down Expand Up @@ -348,6 +349,7 @@ func TestLicenseHeader(t *testing.T) {
"f.awk",
"f.buckconfig", "buck",
"f.bzl", "f.bazel", "build", "f.build",
"f.core",
"f.dockerfile", "dockerfile",
"f.ex", "f.exs",
"f.graphql",
Expand Down
22 changes: 22 additions & 0 deletions testdata/expected/test.core
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CAPI=2:
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: test:core:unit:1.0.0

filesets:
rtl:
files:
- pe.vhd
file_type: vhdlSource
8 changes: 8 additions & 0 deletions testdata/initial/test.core
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CAPI=2:
name: test:core:unit:1.0.0

filesets:
rtl:
files:
- pe.vhd
file_type: vhdlSource