You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ke...@apache.org on 2020/12/21 07:57:56 UTC
[skywalking-eyes] 22/25: Add Java fixing type and reshape the README
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git
commit 7d3e66cb46dde51d478049966d448195b77b3437
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Mon Dec 21 12:30:35 2020 +0800
Add Java fixing type and reshape the README
---
.licenserc.yaml | 1 +
README.adoc | 73 +++++++++++++++++
README.md | 91 ----------------------
cmd/root.go | 4 +-
commands/header/check.go | 3 +
commands/header/fix.go | 3 +
commands/header/header.go | 1 +
pkg/header/check.go | 10 ++-
.../fix/{anglebracket.go => angle_bracket.go} | 2 +-
pkg/header/fix/{doubleslash.go => double_slash.go} | 0
pkg/header/fix/fix.go | 13 +++-
pkg/header/fix/hashtag.go | 13 ++--
.../fix/{doubleslash.go => slash_asterisk.go} | 6 +-
pkg/header/result.go | 11 +++
test/.licenserc_for_test.yaml | 37 ---------
.../.licenserc_for_test_check.yaml | 14 ++--
.../.licenserc_for_test_fix.yaml | 13 ++--
test/include_test/with_license/testcase.go | 25 +++---
test/include_test/with_license/testcase.graphql | 28 ++++---
test/include_test/with_license/testcase.java | 32 ++++----
test/include_test/with_license/testcase.py | 28 ++++---
test/include_test/with_license/testcase.sh | 27 ++++---
test/include_test/with_license/testcase.yaml | 28 ++++---
test/include_test/with_license/testcase.yml | 28 ++++---
24 files changed, 245 insertions(+), 246 deletions(-)
diff --git a/.licenserc.yaml b/.licenserc.yaml
index d14df0b..b8366ec 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -21,6 +21,7 @@ paths-ignore:
- '.idea/**'
- 'bin/**'
- '**/*.md'
+ - '**/.DS_Store'
- 'test/**'
- 'go.mod'
- 'go.sum'
diff --git a/README.adoc b/README.adoc
new file mode 100644
index 0000000..3174252
--- /dev/null
+++ b/README.adoc
@@ -0,0 +1,73 @@
+= license-checker
+:repo: https://github.com/fgksgf/license-checker
+
+A full-featured license guard to check and fix license headers and dependencies' licenses.
+
+== Install
+
+[subs="attributes+",source,bash]
+----
+git clone {repo}
+cd license-checker
+make
+----
+
+== Usage
+
+[source]
+----
+$ license-checker
+
+A full-featured license guard to check and fix license headers and dependencies' licenses.
+
+Usage:
+ license-checker [command]
+
+Available Commands:
+ header License header related commands; e.g. check, fix, etc.
+ help Help about any command
+
+Flags:
+ -h, --help help for license-checker
+ -v, --verbosity string log level (debug, info, warn, error, fatal, panic (default "info")
+
+Use "license-checker [command] --help" for more information about a command.
+----
+
+== Configuration
+
+[source,yaml]
+.test/.licenserc_for_test.yaml
+----
+include::test/.licenserc_for_test_check.yaml[]
+----
+
+== Check
+
+[source]
+----
+bin/license-checker -c test/.licenserc_for_test_fix.yaml header check
+
+INFO Loading configuration from file: test/.licenserc_for_test.yaml serc_for_test.yaml
+INFO Totally checked 23 files, valid: 8, invalid: 8, ignored: 7, fixed: 0
+ERROR The following files don't have a valid license header:
+test/include_test/without_license/testcase.go
+test/include_test/without_license/testcase.graphql
+test/include_test/without_license/testcase.java
+test/include_test/without_license/testcase.md
+test/include_test/without_license/testcase.py
+test/include_test/without_license/testcase.sh
+test/include_test/without_license/testcase.yaml
+test/include_test/without_license/testcase.yml
+exit status 1
+----
+
+== Fix
+
+[source]
+----
+bin/license-checker -c test/.licenserc_for_test_fix.yaml header fix
+
+INFO Loading configuration from file: test/.licenserc_for_test_fix.yaml
+INFO Totally checked 16 files, valid: 7, invalid: 8, ignored: 1, fixed: 8
+----
diff --git a/README.md b/README.md
deleted file mode 100644
index d2039c0..0000000
--- a/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-# license-checker
-
-A CLI tool for checking license headers, which theoretically supports checking all types of files.
-
-## Install
-
-```bash
-git clone https://github.com/fgksgf/license-checker.git
-cd license-checker
-make
-```
-
-## Usage
-
-```
-Usage: license-checker [flags]
-
-license-checker walks the specified path recursively and checks
-if the specified files have the license header in the config file.
-
-Usage:
- license-checker [flags]
-
-Flags:
- -c, --config string the config file (default ".licenserc.json")
- -h, --help help for license-checker
- -l, --loose loose mode
- -p, --path string the path to check (default ".")
- -v, --verbose verbose mode
-```
-
-## Configuration
-
-```
-{
- // What to check in strict mode, the order of strings can NOT be changed arbitrarily
- "licenseStrict": [
- "Licensed to the Apache Software Foundation (ASF) under one or more",
- "contributor license agreements. See the NOTICE file distributed with",
- "..."
- ],
-
- // What to check in loose mode, the order of strings can NOT be changed arbitrarily
- "licenseLoose": [
- "Apache License, Version 2.0"
- ],
-
- // license-checker will check *.java and *.go
- "targetFiles": [
- "java",
- "go"
- ],
-
- "exclude": {
- // license-checker will NOT check these files
- "files": [
- ".gitignore",
- "NOTICE",
- "LICENSE"
- ],
-
- // license-checker will NOT check files whose names with these extensions
- "extensions": [
- "md",
- "xml",
- "json"
- ],
-
- // license-checker will NOT check these directories
- "directories": [
- "bin",
- ".github"
- ]
- }
-}
-```
-
-## Test
-
-```bash
-bin/license-checker -p test -c test/.licenserc_for_test.yaml
-
-[No Specified License]: test/include_test/without_license/testcase.go
-[No Specified License]: test/include_test/without_license/testcase.graphql
-[No Specified License]: test/include_test/without_license/testcase.java
-[No Specified License]: test/include_test/without_license/testcase.py
-[No Specified License]: test/include_test/without_license/testcase.sh
-[No Specified License]: test/include_test/without_license/testcase.yaml
-[No Specified License]: test/include_test/without_license/testcase.yml
-Total check 14 files, success: 7, failure: 7
-```
diff --git a/cmd/root.go b/cmd/root.go
index e6d4b98..91cb6b6 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -31,7 +31,7 @@ var (
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "license-checker command [flags]",
- Long: "license-checker walks the specified path recursively and checks if the specified files have the license header in the config file.",
+ Long: "A full-featured license guard to check and fix license headers and dependencies' licenses",
SilenceUsage: true,
SilenceErrors: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
@@ -47,7 +47,7 @@ var rootCmd = &cobra.Command{
// Execute sets flags to the root command appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() error {
- rootCmd.PersistentFlags().StringVarP(&verbosity, "verbosity", "v", logrus.InfoLevel.String(), "Log level (debug, info, warn, error, fatal, panic")
+ rootCmd.PersistentFlags().StringVarP(&verbosity, "verbosity", "v", logrus.InfoLevel.String(), "log level (debug, info, warn, error, fatal, panic")
rootCmd.AddCommand(headercommand.Header)
diff --git a/commands/header/check.go b/commands/header/check.go
index ef141cc..fc17c53 100644
--- a/commands/header/check.go
+++ b/commands/header/check.go
@@ -19,6 +19,7 @@ package header
import (
"github.com/spf13/cobra"
+ "license-checker/internal/logger"
"license-checker/pkg/header"
)
@@ -43,6 +44,8 @@ var CheckCommand = &cobra.Command{
return err
}
+ logger.Log.Infoln(result.String())
+
if result.HasFailure() {
return result.Error()
}
diff --git a/commands/header/fix.go b/commands/header/fix.go
index dc50e65..624a1f0 100644
--- a/commands/header/fix.go
+++ b/commands/header/fix.go
@@ -20,6 +20,7 @@ package header
import (
"fmt"
"github.com/spf13/cobra"
+ "license-checker/internal/logger"
"license-checker/pkg/header"
"license-checker/pkg/header/fix"
"strings"
@@ -48,6 +49,8 @@ var FixCommand = &cobra.Command{
}
}
+ logger.Log.Infoln(result.String())
+
if len(errors) > 0 {
return fmt.Errorf(strings.Join(errors, "\n"))
}
diff --git a/commands/header/header.go b/commands/header/header.go
index 86d58da..b9e8612 100644
--- a/commands/header/header.go
+++ b/commands/header/header.go
@@ -23,6 +23,7 @@ import (
var Header = &cobra.Command{
Use: "header",
+ Short: "License header related commands; e.g. check, fix, etc.",
Long: "`header` command walks the specified paths recursively and checks if the specified files have the license header in the config file.",
Aliases: []string{"h"},
}
diff --git a/pkg/header/check.go b/pkg/header/check.go
index 006fc9c..31eb6c7 100644
--- a/pkg/header/check.go
+++ b/pkg/header/check.go
@@ -39,6 +39,8 @@ func Check(config *Config, result *Result) error {
return nil
}
+var seen = make(map[string]bool)
+
func checkPattern(pattern string, result *Result, config *Config) error {
paths, err := doublestar.Glob(pattern)
@@ -48,18 +50,18 @@ func checkPattern(pattern string, result *Result, config *Config) error {
for _, path := range paths {
if yes, err := config.ShouldIgnore(path); yes || err != nil {
+ result.Ignore(path)
continue
}
if err = checkPath(path, result, config); err != nil {
return err
}
+ seen[path] = true
}
return nil
}
-var seen = make(map[string]bool)
-
func checkPath(path string, result *Result, config *Config) error {
defer func() { seen[path] = true }()
@@ -95,6 +97,9 @@ func checkPath(path string, result *Result, config *Config) error {
// CheckFile checks whether or not the file contains the configured license header.
func CheckFile(file string, config *Config, result *Result) error {
if yes, err := config.ShouldIgnore(file); yes || err != nil {
+ if !seen[file] {
+ result.Ignore(file)
+ }
return err
}
@@ -118,7 +123,6 @@ func CheckFile(file string, config *Config, result *Result) error {
if content := strings.Join(lines, " "); !strings.Contains(content, config.NormalizedLicense()) {
logger.Log.Debugln("Content is:", content)
- logger.Log.Debugln("License is:", config.License)
result.Fail(file)
} else {
diff --git a/pkg/header/fix/anglebracket.go b/pkg/header/fix/angle_bracket.go
similarity index 93%
rename from pkg/header/fix/anglebracket.go
rename to pkg/header/fix/angle_bracket.go
index e027536..ac31302 100644
--- a/pkg/header/fix/anglebracket.go
+++ b/pkg/header/fix/angle_bracket.go
@@ -38,7 +38,7 @@ func AngleBracket(file string, config *header.Config, result *header.Result) err
return err
}
- if !reflect.DeepEqual(content[0:5], []byte("<?xml")) { // doesn't contains xml declaration
+ if len(content) > 5 && !reflect.DeepEqual(content[0:5], []byte("<?xml")) { // doesn't contains xml declaration
lines := "<!--\n ~ " + strings.Join(strings.Split(config.License, "\n"), "\n ~ ") + "\n-->\n"
if err := ioutil.WriteFile(file, append([]byte(lines), content...), stat.Mode()); err != nil {
diff --git a/pkg/header/fix/doubleslash.go b/pkg/header/fix/double_slash.go
similarity index 100%
copy from pkg/header/fix/doubleslash.go
copy to pkg/header/fix/double_slash.go
diff --git a/pkg/header/fix/fix.go b/pkg/header/fix/fix.go
index 48b3c47..bba4df0 100644
--- a/pkg/header/fix/fix.go
+++ b/pkg/header/fix/fix.go
@@ -25,13 +25,20 @@ import (
)
var suffixToFunc = map[string]func(string, *header.Config, *header.Result) error{
- ".go": DoubleSlash,
+ ".go": DoubleSlash,
+
+ ".py": Hashtag, // TODO: tackle shebang
+ ".sh": Hashtag, // TODO: tackle shebang
".yml": Hashtag,
".yaml": Hashtag,
- "Dockerfile": Hashtag,
+ ".graphql": Hashtag,
"Makefile": Hashtag,
+ "Dockerfile": Hashtag,
".gitignore": Hashtag,
- ".md": AngleBracket,
+
+ ".md": AngleBracket,
+
+ ".java": SlashAsterisk,
}
// Fix adds the configured license header to the given file.
diff --git a/pkg/header/fix/hashtag.go b/pkg/header/fix/hashtag.go
index 761acc8..601da4b 100644
--- a/pkg/header/fix/hashtag.go
+++ b/pkg/header/fix/hashtag.go
@@ -21,6 +21,7 @@ import (
"io/ioutil"
"license-checker/pkg/header"
"os"
+ "reflect"
"strings"
)
@@ -36,13 +37,15 @@ func Hashtag(file string, config *header.Config, result *header.Result) error {
return err
}
- lines := "# " + strings.Join(strings.Split(config.License, "\n"), "\n# ") + "\n"
+ if len(content) >= 3 && !reflect.DeepEqual(content[0:3], []byte("#! ")) || len(content) < 3 { // doesn't contains shebang
+ lines := "# " + strings.Join(strings.Split(config.License, "\n"), "\n# ") + "\n"
- if err := ioutil.WriteFile(file, append([]byte(lines), content...), stat.Mode()); err != nil {
- return err
- }
+ if err := ioutil.WriteFile(file, append([]byte(lines), content...), stat.Mode()); err != nil {
+ return err
+ }
- result.Fix(file)
+ result.Fix(file)
+ }
return nil
}
diff --git a/pkg/header/fix/doubleslash.go b/pkg/header/fix/slash_asterisk.go
similarity index 81%
rename from pkg/header/fix/doubleslash.go
rename to pkg/header/fix/slash_asterisk.go
index ab2819a..adbf4e8 100644
--- a/pkg/header/fix/doubleslash.go
+++ b/pkg/header/fix/slash_asterisk.go
@@ -24,8 +24,8 @@ import (
"strings"
)
-// DoubleSlash adds the configured license header to files whose comment starts with //.
-func DoubleSlash(file string, config *header.Config, result *header.Result) error {
+// SlashAsterisk adds the configured license header to files whose comment starts with /**.
+func SlashAsterisk(file string, config *header.Config, result *header.Result) error {
stat, err := os.Stat(file)
if err != nil {
return err
@@ -36,7 +36,7 @@ func DoubleSlash(file string, config *header.Config, result *header.Result) erro
return err
}
- lines := "// " + strings.Join(strings.Split(config.License, "\n"), "\n// ") + "\n"
+ lines := "/*\n * " + strings.Join(strings.Split(config.License, "\n"), "\n * ") + "\n */\n"
if err := ioutil.WriteFile(file, append([]byte(lines), content...), stat.Mode()); err != nil {
return err
diff --git a/pkg/header/result.go b/pkg/header/result.go
index e979154..ea17fb6 100644
--- a/pkg/header/result.go
+++ b/pkg/header/result.go
@@ -55,3 +55,14 @@ func (result *Result) Error() error {
strings.Join(result.Failure, "\n"),
)
}
+
+func (result *Result) String() string {
+ return fmt.Sprintf(
+ "Totally checked %d files, valid: %d, invalid: %d, ignored: %d, fixed: %d",
+ len(result.Success)+len(result.Failure)+len(result.Ignored),
+ len(result.Success),
+ len(result.Failure),
+ len(result.Ignored),
+ len(result.Fixed),
+ )
+}
diff --git a/test/.licenserc_for_test.yaml b/test/.licenserc_for_test.yaml
deleted file mode 100644
index bc6d434..0000000
--- a/test/.licenserc_for_test.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-#
-# 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.
-
-license: >-
- Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-
- 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.
-
-paths:
- - 'test/include_test'
-
-paths-ignore:
- - '.git/**/*'
- - '**/*.md'
- - '**/.DS_Store'
- - 'exclude_test/**/*'
diff --git a/.licenserc.yaml b/test/.licenserc_for_test_check.yaml
similarity index 89%
copy from .licenserc.yaml
copy to test/.licenserc_for_test_check.yaml
index d14df0b..b4c1eb8 100644
--- a/.licenserc.yaml
+++ b/test/.licenserc_for_test_check.yaml
@@ -16,12 +16,10 @@ license: |
specific language governing permissions and limitations
under the License.
-paths-ignore:
- - '.git/**'
- - '.idea/**'
- - 'bin/**'
- - '**/*.md'
+paths:
- 'test/**'
- - 'go.mod'
- - 'go.sum'
- - 'LICENSE'
+
+paths-ignore:
+ - '**/.DS_Store'
+ - '**/.json'
+ - '**/exclude_test/**'
diff --git a/.licenserc.yaml b/test/.licenserc_for_test_fix.yaml
similarity index 88%
copy from .licenserc.yaml
copy to test/.licenserc_for_test_fix.yaml
index d14df0b..27d3087 100644
--- a/.licenserc.yaml
+++ b/test/.licenserc_for_test_fix.yaml
@@ -16,12 +16,9 @@ license: |
specific language governing permissions and limitations
under the License.
+paths:
+ - 'test/include_test/**'
+
paths-ignore:
- - '.git/**'
- - '.idea/**'
- - 'bin/**'
- - '**/*.md'
- - 'test/**'
- - 'go.mod'
- - 'go.sum'
- - 'LICENSE'
+ - '**/.DS_Store'
+ - '**/.json'
diff --git a/test/include_test/with_license/testcase.go b/test/include_test/with_license/testcase.go
index a32a9c8..0f54b96 100644
--- a/test/include_test/with_license/testcase.go
+++ b/test/include_test/with_license/testcase.go
@@ -1,15 +1,18 @@
-// Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you 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
+// 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.
//
-// 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.
-
package with_license
diff --git a/test/include_test/with_license/testcase.graphql b/test/include_test/with_license/testcase.graphql
index d1d7d28..b34560e 100644
--- a/test/include_test/with_license/testcase.graphql
+++ b/test/include_test/with_license/testcase.graphql
@@ -1,13 +1,17 @@
-# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
+# Licensed to Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Apache Software Foundation (ASF) licenses this file to you 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.
+#
+# 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.
+#
diff --git a/test/include_test/with_license/testcase.java b/test/include_test/with_license/testcase.java
index 651fadd..a388cbc 100644
--- a/test/include_test/with_license/testcase.java
+++ b/test/include_test/with_license/testcase.java
@@ -1,14 +1,18 @@
-// Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-//
-// 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.
-
+/**
+ * Licensed to Apache Software Foundation (ASF) under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Apache Software Foundation (ASF) licenses this file to you 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.
+ */
diff --git a/test/include_test/with_license/testcase.py b/test/include_test/with_license/testcase.py
index d1d7d28..b34560e 100644
--- a/test/include_test/with_license/testcase.py
+++ b/test/include_test/with_license/testcase.py
@@ -1,13 +1,17 @@
-# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
+# Licensed to Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Apache Software Foundation (ASF) licenses this file to you 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.
+#
+# 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.
+#
diff --git a/test/include_test/with_license/testcase.sh b/test/include_test/with_license/testcase.sh
index 69d2c0c..572342e 100644
--- a/test/include_test/with_license/testcase.sh
+++ b/test/include_test/with_license/testcase.sh
@@ -1,15 +1,18 @@
-# /bin/bash
-
-# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
+#! /bin/bash
+# Licensed to Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Apache Software Foundation (ASF) licenses this file to you 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
+# 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.
#
-# 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.
diff --git a/test/include_test/with_license/testcase.yaml b/test/include_test/with_license/testcase.yaml
index d1d7d28..b34560e 100644
--- a/test/include_test/with_license/testcase.yaml
+++ b/test/include_test/with_license/testcase.yaml
@@ -1,13 +1,17 @@
-# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
+# Licensed to Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Apache Software Foundation (ASF) licenses this file to you 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.
+#
+# 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.
+#
diff --git a/test/include_test/with_license/testcase.yml b/test/include_test/with_license/testcase.yml
index d1d7d28..b34560e 100644
--- a/test/include_test/with_license/testcase.yml
+++ b/test/include_test/with_license/testcase.yml
@@ -1,13 +1,17 @@
-# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
+# Licensed to Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Apache Software Foundation (ASF) licenses this file to you 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.
+#
+# 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.
+#