You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/10/23 14:10:47 UTC
[skywalking-data-collect-protocol] branch master updated: Replace
license checker with license eye (#55)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-data-collect-protocol.git
The following commit(s) were added to refs/heads/master by this push:
new 21492e4 Replace license checker with license eye (#55)
21492e4 is described below
commit 21492e496b797567d0e127f4510509baf73e10fd
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Sat Oct 23 22:10:40 2021 +0800
Replace license checker with license eye (#55)
---
.github/workflows/ci.yaml | 4 +--
tools/check-license-header.py | 70 -------------------------------------------
2 files changed, 2 insertions(+), 72 deletions(-)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 4fe81b2..1f21e83 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -26,10 +26,10 @@ on:
jobs:
CI:
runs-on: ubuntu-18.04
- timeout-minutes: 90
+ timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Check License Headers
- run: python3 tools/check-license-header.py .
+ uses: apache/skywalking-eyes@6e387ca914675222f0df405660f88bc803c297bf
diff --git a/tools/check-license-header.py b/tools/check-license-header.py
deleted file mode 100644
index 2039278..0000000
--- a/tools/check-license-header.py
+++ /dev/null
@@ -1,70 +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)
- if '.git' in file_path or filename.endswith('.md'):
- continue
- 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('%s license header in file: %s' % ('✅' if license_header in header else '❌', 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)