You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2022/07/06 08:50:40 UTC

[skywalking-python] branch license created (now 18568af)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch license
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


      at 18568af  Migrate license checker to license-eye

This branch includes the following new commits:

     new 18568af  Migrate license checker to license-eye

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking-python] 01/01: Migrate license checker to license-eye

Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch license
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git

commit 18568afaacc6d93043d1264106d4f483b7c03cde
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Wed Jul 6 16:50:24 2022 +0800

    Migrate license checker to license-eye
---
 Makefile                      |  2 +-
 tools/check-license-header.py | 68 -------------------------------------------
 2 files changed, 1 insertion(+), 69 deletions(-)

diff --git a/Makefile b/Makefile
index 5ffbc4f..599c658 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ check-doc-gen: dev-setup doc-gen
 	fi
 
 license: clean
-	$(VENV)/python tools/check-license-header.py skywalking tests tools
+	docker run -it --rm -v $(shell pwd):/github/workspace ghcr.io/apache/skywalking-eyes/license-eye:f461a46e74e5fa22e9f9599a355ab4f0ac265469 header check
 
 test: gen setup-test
 	$(VENV)/python -m pytest -v tests
diff --git a/tools/check-license-header.py b/tools/check-license-header.py
deleted file mode 100755
index 9e71b10..0000000
--- a/tools/check-license-header.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# 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.
-#
-
-import os
-import sys
-
-ignored_chars = '#\n \t:'
-
-license_header = ' '.join(
-    [
-        line.strip(ignored_chars) for line in """
-        #
-        # 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.
-        #
-        """.splitlines()
-    ]
-).strip(ignored_chars)
-
-comment_leading_chars = ('#', '::')
-
-
-def walk_through_dir(d) -> bool:
-    checked = True
-    for root, _sub_dirs, files in os.walk(d):
-        for filename in files:
-            file_path = os.path.join(root, filename)
-            with open(file_path, 'r') as f:
-                header = ' '.join([
-                    line.strip(ignored_chars) for line in f.readlines() if line.startswith(comment_leading_chars)
-                ]).strip()
-                print(f"{'✅' if license_header in header else '❌'} license header in file: {file_path}")
-                checked &= license_header in header
-    return checked
-
-
-if __name__ == '__main__':
-    checked = True
-    for _, directory in enumerate(sys.argv):
-        checked &= walk_through_dir(directory)
-    if not checked:
-        sys.exit(1)