Add Java fixing type and reshape the README
diff --git a/.licenserc.yaml b/.licenserc.yaml
index d14df0b..b8366ec 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -21,6 +21,7 @@
- '.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 @@
// 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 @@
// 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 @@
import (
"github.com/spf13/cobra"
+ "license-checker/internal/logger"
"license-checker/pkg/header"
)
@@ -43,6 +44,8 @@
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 @@
import (
"fmt"
"github.com/spf13/cobra"
+ "license-checker/internal/logger"
"license-checker/pkg/header"
"license-checker/pkg/header/fix"
"strings"
@@ -48,6 +49,8 @@
}
}
+ 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 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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%
rename from pkg/header/fix/doubleslash.go
rename 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 @@
)
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 @@
"io/ioutil"
"license-checker/pkg/header"
"os"
+ "reflect"
"strings"
)
@@ -36,13 +37,15 @@
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/anglebracket.go b/pkg/header/fix/slash_asterisk.go
similarity index 62%
copy from pkg/header/fix/anglebracket.go
copy to pkg/header/fix/slash_asterisk.go
index e027536..adbf4e8 100644
--- a/pkg/header/fix/anglebracket.go
+++ b/pkg/header/fix/slash_asterisk.go
@@ -18,16 +18,14 @@
package fix
import (
- "fmt"
"io/ioutil"
"license-checker/pkg/header"
"os"
- "reflect"
"strings"
)
-// AngleBracket adds the configured license header to files whose comment starts with <!--.
-func AngleBracket(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
@@ -38,18 +36,13 @@
return err
}
- if !reflect.DeepEqual(content[0:5], []byte("<?xml")) { // doesn't contains xml declaration
- lines := "<!--\n ~ " + strings.Join(strings.Split(config.License, "\n"), "\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
- }
-
- result.Fix(file)
- } else {
- // TODO: tackle with the "xml declaration"
- return fmt.Errorf("xml with xml declaration is not supported yet")
+ if err := ioutil.WriteFile(file, append([]byte(lines), content...), stat.Mode()); err != nil {
+ return err
}
+ result.Fix(file)
+
return nil
}
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 @@
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 <hoshea@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 <hoshea@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/test/.licenserc_for_test_check.yaml b/test/.licenserc_for_test_check.yaml
new file mode 100644
index 0000000..b4c1eb8
--- /dev/null
+++ b/test/.licenserc_for_test_check.yaml
@@ -0,0 +1,25 @@
+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.
+
+paths:
+ - 'test/**'
+
+paths-ignore:
+ - '**/.DS_Store'
+ - '**/.json'
+ - '**/exclude_test/**'
diff --git a/test/.licenserc_for_test_fix.yaml b/test/.licenserc_for_test_fix.yaml
new file mode 100644
index 0000000..27d3087
--- /dev/null
+++ b/test/.licenserc_for_test_fix.yaml
@@ -0,0 +1,24 @@
+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.
+
+paths:
+ - 'test/include_test/**'
+
+paths-ignore:
+ - '**/.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 <hoshea@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 <hoshea@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 <hoshea@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 <hoshea@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 <hoshea@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 <hoshea@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 <hoshea@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.
+#