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:52 UTC

[skywalking-eyes] 18/25: Fix license header and setup self checker (#3)

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 0ca8fae12cd6a2a0540a6870c094542e16382d45
Author: Zhenxu Ke <ke...@163.com>
AuthorDate: Sun Dec 20 16:37:00 2020 +0800

    Fix license header and setup self checker (#3)
---
 .github/workflows/build.yaml                    |  17 ++--
 .gitignore                                      |  16 +++-
 .licenserc.yaml                                 |  26 +++---
 Dockerfile                                      |  16 ++--
 Makefile                                        |   8 +-
 README.md                                       |   2 +-
 action.yml                                      |  14 ++-
 cmd/root.go                                     |   1 +
 commands/header/check.go                        |  20 ++++-
 commands/header/header.go                       |  14 +++
 internal/logger/log.go                          |  24 +++--
 pkg/header/check.go                             |  14 +++
 pkg/header/model.go                             |  14 +++
 pkg/util/str.go                                 |  53 -----------
 pkg/util/str_test.go                            | 113 ------------------------
 test/.licenserc_for_test.json                   |  41 ---------
 test/.licenserc_for_test.yaml                   |  37 ++++++++
 test/include_test/with_license/testcase.go      |  29 +++---
 test/include_test/with_license/testcase.graphql |  13 ++-
 test/include_test/with_license/testcase.java    |  14 +--
 test/include_test/with_license/testcase.py      |  13 ++-
 test/include_test/with_license/testcase.sh      |  13 ++-
 test/include_test/with_license/testcase.yaml    |  15 ++--
 test/include_test/with_license/testcase.yml     |  13 ++-
 24 files changed, 210 insertions(+), 330 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 74f7320..55f216f 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -1,12 +1,10 @@
-# Licensed to the 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.  The 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
+# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 #
-#     http://www.apache.org/licenses/LICENSE-2.0
+# 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,
@@ -33,5 +31,8 @@ jobs:
 
       - uses: actions/checkout@v2
 
+      - name: Selfcheck License
+        run: make license
+
       - name: Build
         run: make build
diff --git a/.gitignore b/.gitignore
index 8741f5d..1bbee36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,16 @@
+# 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.
+
 .idea/
-bin/
\ No newline at end of file
+bin/
diff --git a/.licenserc.yaml b/.licenserc.yaml
index c23a250..dff9cb9 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -1,21 +1,23 @@
-mode: strict
+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
 
-license: >
-  Licensed to the 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.
-  The 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:
+  - '.git/**'
+  - '.idea/**'
   - '**/*.md'
+  - 'test/**'
+  - 'go.mod'
+  - 'go.sum'
+  - 'LICENSE'
diff --git a/Dockerfile b/Dockerfile
index 1205638..602de2d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,10 @@
-# Licensed to the 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.  The 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
+# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 #
-#     http://www.apache.org/licenses/LICENSE-2.0
+# 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,
@@ -28,4 +26,4 @@ COPY --from=build /bin/license-checker /bin/license-checker
 
 WORKDIR /github/workspace/
 
-ENTRYPOINT /bin/license-checker
+ENTRYPOINT /bin/license-checker header check -v debug
diff --git a/Makefile b/Makefile
index 133f4d7..6220eba 100644
--- a/Makefile
+++ b/Makefile
@@ -25,13 +25,11 @@ GO_BUILD = $(GO) build
 GO_GET = $(GO) get
 GO_TEST = $(GO) test
 GO_LINT = $(GO_PATH)/bin/golangci-lint
-GO_LICENSER = $(GO_PATH)/bin/go-licenser
 
 all: clean deps lint test build
 
 tools:
 	mkdir -p $(GO_PATH)/bin
-	#$(GO_LICENSER) -version || GO111MODULE=off $(GO_GET) -u github.com/elastic/go-licenser
 
 deps: tools
 	$(GO_GET) -v -t -d ./...
@@ -51,9 +49,9 @@ test: clean lint
 build: deps
 	$(GO_BUILD) -o $(OUT_DIR)/$(PROJECT)
 
-#.PHONY: license
-#license: clean tools
-#	$(GO_LICENSER) -d -license='ASL2' .
+.PHONY: license
+license: clean
+	$(GO) run main.go header check
 
 .PHONY: fix
 fix: tools
diff --git a/README.md b/README.md
index 255cd15..d2039c0 100644
--- a/README.md
+++ b/README.md
@@ -78,7 +78,7 @@ Flags:
 ## Test
 
 ```bash
-bin/license-checker -p test -c test/.licenserc_for_test.json
+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
diff --git a/action.yml b/action.yml
index e43035f..f9773c5 100644
--- a/action.yml
+++ b/action.yml
@@ -1,12 +1,10 @@
-# Licensed to the 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.  The 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
+# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 #
-#     http://www.apache.org/licenses/LICENSE-2.0
+# 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,
diff --git a/cmd/root.go b/cmd/root.go
index 68cc5eb..93a195e 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -13,6 +13,7 @@ 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 cmd
 
 import (
diff --git a/commands/header/check.go b/commands/header/check.go
index 24d316b..b020882 100644
--- a/commands/header/check.go
+++ b/commands/header/check.go
@@ -1,3 +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.
+// 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.
+
 package header
 
 import (
@@ -50,9 +64,13 @@ func loadConfig(config *header.Config) error {
 			lines = append(lines, strings.Trim(line, header.CommentChars))
 		}
 	}
-	config.License = strings.Join(lines, "\n")
+	config.License = strings.Join(lines, " ")
 
 	logger.Log.Infoln("License header is:", config.License)
 
+	if len(config.Paths) == 0 {
+		config.Paths = []string{"**"}
+	}
+
 	return nil
 }
diff --git a/commands/header/header.go b/commands/header/header.go
index 5879a40..d6cb659 100644
--- a/commands/header/header.go
+++ b/commands/header/header.go
@@ -1,3 +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.
+// 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.
+
 package header
 
 import (
diff --git a/internal/logger/log.go b/internal/logger/log.go
index 4803978..602437b 100644
--- a/internal/logger/log.go
+++ b/internal/logger/log.go
@@ -1,19 +1,16 @@
-// 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.
+// 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
+// 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 logger
 
@@ -34,5 +31,6 @@ func init() {
 	Log.SetFormatter(&logrus.TextFormatter{
 		DisableTimestamp:       true,
 		DisableLevelTruncation: true,
+		ForceColors:            true,
 	})
 }
diff --git a/pkg/header/check.go b/pkg/header/check.go
index aef1c8e..0defbe4 100644
--- a/pkg/header/check.go
+++ b/pkg/header/check.go
@@ -1,3 +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.
+// 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.
+
 package header
 
 import (
diff --git a/pkg/header/model.go b/pkg/header/model.go
index 8401cae..5af67fd 100644
--- a/pkg/header/model.go
+++ b/pkg/header/model.go
@@ -1,3 +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.
+// 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.
+
 package header
 
 type Config struct {
diff --git a/pkg/util/str.go b/pkg/util/str.go
deleted file mode 100644
index e907b90..0000000
--- a/pkg/util/str.go
+++ /dev/null
@@ -1,53 +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.
-*/
-package util
-
-import (
-	"strings"
-)
-
-func InStrSliceMapKeyFunc(strs []string) func(string) bool {
-	set := make(map[string]struct{})
-
-	for _, e := range strs {
-		set[e] = struct{}{}
-	}
-
-	return func(s string) bool {
-		_, ok := set[s]
-		return ok
-	}
-}
-
-func GetFileExtension(filename string) string {
-	i := strings.LastIndex(filename, ".")
-	if i != -1 {
-		if i+1 < len(filename) {
-			return filename[i+1:]
-		}
-	}
-	return ""
-}
-
-func CleanPathPrefixes(path string, prefixes []string) string {
-	for _, prefix := range prefixes {
-		if strings.HasPrefix(path, prefix) && len(path) > 0 {
-			path = path[len(prefix):]
-		}
-	}
-
-	return path
-}
diff --git a/pkg/util/str_test.go b/pkg/util/str_test.go
deleted file mode 100644
index cf64a96..0000000
--- a/pkg/util/str_test.go
+++ /dev/null
@@ -1,113 +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.
-*/
-package util
-
-import (
-	"os"
-	"testing"
-)
-
-func TestGetFileExtension(t *testing.T) {
-	type args struct {
-		filename string
-	}
-	tests := []struct {
-		name string
-		args args
-		want string
-	}{
-		{
-			name: "txt extension",
-			args: args{
-				filename: ".abc.txt",
-			},
-			want: "txt",
-		},
-		{
-			name: "no file extensions",
-			args: args{
-				filename: ".abc.txt.",
-			},
-			want: "",
-		},
-		{
-			name: "no file extensions",
-			args: args{
-				filename: "lkjsdl",
-			},
-			want: "",
-		},
-	}
-	for _, tt := range tests {
-		t.Run(tt.name, func(t *testing.T) {
-			if got := GetFileExtension(tt.args.filename); got != tt.want {
-				t.Errorf("GetFileExtension() = %v, want %v", got, tt.want)
-			}
-		})
-	}
-}
-
-func Test_cleanPathPrefixes(t *testing.T) {
-	type args struct {
-		path     string
-		prefixes []string
-	}
-	tests := []struct {
-		name string
-		args args
-		want string
-	}{
-		{
-			name: "",
-			args: args{
-				path:     "test/exclude_test",
-				prefixes: []string{"test", string(os.PathSeparator)},
-			},
-			want: "exclude_test",
-		},
-		{
-			name: "",
-			args: args{
-				path:     "test/exclude_test/directories",
-				prefixes: []string{"test", string(os.PathSeparator)},
-			},
-			want: "exclude_test/directories",
-		},
-		{
-			name: "",
-			args: args{
-				path:     "./.git/",
-				prefixes: []string{".", string(os.PathSeparator)},
-			},
-			want: ".git/",
-		},
-		{
-			name: "",
-			args: args{
-				path:     "test/exclude_test/directories",
-				prefixes: []string{"test/", string(os.PathSeparator)},
-			},
-			want: "exclude_test/directories",
-		},
-	}
-	for _, tt := range tests {
-		t.Run(tt.name, func(t *testing.T) {
-			if got := CleanPathPrefixes(tt.args.path, tt.args.prefixes); got != tt.want {
-				t.Errorf("CleanPathPrefixes() = %v, want %v", got, tt.want)
-			}
-		})
-	}
-}
diff --git a/test/.licenserc_for_test.json b/test/.licenserc_for_test.json
deleted file mode 100644
index 8eaaa64..0000000
--- a/test/.licenserc_for_test.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-  "licenseStrict": [
-    "Licensed to the 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.",
-    "The 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."
-  ],
-  "licenseLoose": [
-    "Apache License, Version 2.0"
-  ],
-  "targetFiles": [
-    "java",
-    "go",
-    "py",
-    "sh",
-    "graphql",
-    "yaml",
-    "yml"
-  ],
-  "exclude": {
-    "files": [
-      ".DS_Store"
-    ],
-    "extensions": [
-      "md",
-      "xml",
-      "json"
-    ],
-    "directories": [
-      "exclude_test/directories"
-    ]
-  }
-}
\ No newline at end of file
diff --git a/test/.licenserc_for_test.yaml b/test/.licenserc_for_test.yaml
new file mode 100644
index 0000000..bc6d434
--- /dev/null
+++ b/test/.licenserc_for_test.yaml
@@ -0,0 +1,37 @@
+# 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/test/include_test/with_license/testcase.go b/test/include_test/with_license/testcase.go
index 6015e2e..a32a9c8 100644
--- a/test/include_test/with_license/testcase.go
+++ b/test/include_test/with_license/testcase.go
@@ -1,18 +1,15 @@
-/*
- * Licensed to the 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.
- * The 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.
- */
+// 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.
 
 package with_license
diff --git a/test/include_test/with_license/testcase.graphql b/test/include_test/with_license/testcase.graphql
index a9fd83f..d1d7d28 100644
--- a/test/include_test/with_license/testcase.graphql
+++ b/test/include_test/with_license/testcase.graphql
@@ -1,16 +1,13 @@
+# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 #
-# Licensed to the 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.
-# The 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
+# 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
+# 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.
-#
\ No newline at end of file
diff --git a/test/include_test/with_license/testcase.java b/test/include_test/with_license/testcase.java
index 63f7276..651fadd 100644
--- a/test/include_test/with_license/testcase.java
+++ b/test/include_test/with_license/testcase.java
@@ -1,14 +1,14 @@
-// Licensed to the 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.
-// The 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
+// Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 //
-//     http://www.apache.org/licenses/LICENSE-2.0
+// 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.
+
diff --git a/test/include_test/with_license/testcase.py b/test/include_test/with_license/testcase.py
index a9fd83f..d1d7d28 100644
--- a/test/include_test/with_license/testcase.py
+++ b/test/include_test/with_license/testcase.py
@@ -1,16 +1,13 @@
+# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 #
-# Licensed to the 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.
-# The 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
+# 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
+# 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.
-#
\ No newline at end of file
diff --git a/test/include_test/with_license/testcase.sh b/test/include_test/with_license/testcase.sh
index c251402..69d2c0c 100644
--- a/test/include_test/with_license/testcase.sh
+++ b/test/include_test/with_license/testcase.sh
@@ -1,18 +1,15 @@
 # /bin/bash
 
+# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 #
-# Licensed to the 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.
-# The 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
+# 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
+# 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.
-#
\ No newline at end of file
diff --git a/test/include_test/with_license/testcase.yaml b/test/include_test/with_license/testcase.yaml
index c2ff44f..d1d7d28 100644
--- a/test/include_test/with_license/testcase.yaml
+++ b/test/include_test/with_license/testcase.yaml
@@ -1,18 +1,13 @@
+# 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
 #
-#
-# Licensed to the 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.
-# The 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.
-#
\ No newline at end of file
diff --git a/test/include_test/with_license/testcase.yml b/test/include_test/with_license/testcase.yml
index a9fd83f..d1d7d28 100644
--- a/test/include_test/with_license/testcase.yml
+++ b/test/include_test/with_license/testcase.yml
@@ -1,16 +1,13 @@
+# Copyright © 2020 Hoshea Jiang <ho...@apache.org>
 #
-# Licensed to the 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.
-# The 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
+# 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
+# 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.
-#
\ No newline at end of file