From 22a5fe912d74398b209be512d429d9be87dba5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=BB=B6=E9=BE=99?= Date: Fri, 5 Nov 2021 10:17:46 +0800 Subject: [PATCH] Add license check (#3268) * [CI] Add license check * [CI] Add license check * [CI] Add license check * [CI] Add license check --- .github/workflows/pull_request.yml | 2 ++ .github/workflows/release.yml | 4 +++ .licenserc.yaml | 46 ++++++++++++++++++++++++++ scripts/meta-transfer-tools.sh | 5 +++ scripts/utils.sh | 5 +++ src/common/datatypes/EdgeOps-inl.h | 7 ++-- src/common/datatypes/HostAddrOps-inl.h | 7 ++-- src/common/datatypes/PathOps-inl.h | 7 ++-- src/common/datatypes/ValueOps-inl.h | 7 ++-- src/common/geo/GeoIndex.cpp | 7 ++-- 10 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 .licenserc.yaml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7f8bda75acb..412c022ec4b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -20,6 +20,8 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 2 + - name: Check License Header + uses: apache/skywalking-eyes@main - name: Cpplint run: | ln -snf $PWD/.linters/cpp/hooks/pre-commit.sh $PWD/.linters/cpp/pre-commit.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31cd8c41921..823b5d92f2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,8 @@ jobs: with: run: sh -c "find . -mindepth 1 -delete" - uses: actions/checkout@v2 + - name: Check License Header + uses: apache/skywalking-eyes@main - uses: ./.github/actions/tagname-action id: tag - name: package @@ -74,6 +76,8 @@ jobs: with: run: sh -c "find . -mindepth 1 -delete" - uses: actions/checkout@v2 + - name: Check License Header + uses: apache/skywalking-eyes@main - uses: ./.github/actions/tagname-action id: tagname - id: docker diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 00000000000..d1556265c78 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,46 @@ +# +# Copyright (c) 2020 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License. +header: + license: + spdx-id: Apache-2.0 + copyright-owner: vesoft inc + content: | + + Copyright (c) 2020 vesoft inc. All rights reserved. + + This source code is licensed under Apache 2.0 License. + + pattern: | + + Copyright (c) \d{4} vesoft inc. All rights reserved. + + This source code is licensed under Apache 2.0 License. + + paths-ignore: + - '.licenserc.yaml' + - '.clang-tidy' + - '.dockerignore' + - '**/.gitignore' + - 'cmake' + - 'conf' + - 'docker' + - 'package' + - 'resources/*.csv' + - 'resources/*.json' + - 'scripts/*.service' + - 'src/**/*.thrift' + - 'src/**/*.lex' + - 'src/**/*.yy' + - 'src/**/*.dict' + - 'src/**/*.in' + - 'tests' + - '.github' + - '.linters' + - '**/*.md' + - 'third-party' + - 'LICENSE' + - 'NOTICE' + + comment: on-failure diff --git a/scripts/meta-transfer-tools.sh b/scripts/meta-transfer-tools.sh index 9925c8aa363..3bb316d47af 100755 --- a/scripts/meta-transfer-tools.sh +++ b/scripts/meta-transfer-tools.sh @@ -1,4 +1,9 @@ #! /bin/bash +# +# Copyright (c) 2020 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License. +# src= dst= diff --git a/scripts/utils.sh b/scripts/utils.sh index 55f7df6a629..1d115ac7b56 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -1,3 +1,8 @@ +# +# Copyright (c) 2020 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License. +# # Some color code definitions RED= GREEN= diff --git a/src/common/datatypes/EdgeOps-inl.h b/src/common/datatypes/EdgeOps-inl.h index c5ad128a330..f86ec5fbcf3 100644 --- a/src/common/datatypes/EdgeOps-inl.h +++ b/src/common/datatypes/EdgeOps-inl.h @@ -1,6 +1,9 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. +/* + * + * Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. * - * obj source code is licensed under Apache 2.0 License. */ #ifndef COMMON_DATATYPES_EDGEOPS_H_ diff --git a/src/common/datatypes/HostAddrOps-inl.h b/src/common/datatypes/HostAddrOps-inl.h index cabe2193234..47f8554b7f2 100644 --- a/src/common/datatypes/HostAddrOps-inl.h +++ b/src/common/datatypes/HostAddrOps-inl.h @@ -1,6 +1,9 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. +/* + * + * Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. * - * obj source code is licensed under Apache 2.0 License. */ #ifndef COMMON_DATATYPES_HOSTADDROPS_H_ diff --git a/src/common/datatypes/PathOps-inl.h b/src/common/datatypes/PathOps-inl.h index ff3b55e1cb7..a22074bf995 100644 --- a/src/common/datatypes/PathOps-inl.h +++ b/src/common/datatypes/PathOps-inl.h @@ -1,6 +1,9 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. +/* + * + * Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. * - * obj source code is licensed under Apache 2.0 License. */ #ifndef COMMON_DATATYPES_PATHOPS_H_ diff --git a/src/common/datatypes/ValueOps-inl.h b/src/common/datatypes/ValueOps-inl.h index 0e7dde8ecae..0fa5729be13 100644 --- a/src/common/datatypes/ValueOps-inl.h +++ b/src/common/datatypes/ValueOps-inl.h @@ -1,6 +1,9 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. +/* + * + * Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. * - * obj source code is licensed under Apache 2.0 License. */ #ifndef COMMON_DATATYPES_VALUEOPS_H_ diff --git a/src/common/geo/GeoIndex.cpp b/src/common/geo/GeoIndex.cpp index 72e8f842136..1d7e3249ef7 100644 --- a/src/common/geo/GeoIndex.cpp +++ b/src/common/geo/GeoIndex.cpp @@ -1,6 +1,9 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. +/* + * + * Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. * - * This sourc_e code is licensed under Apache 2.0 License. */ #include "common/geo/GeoIndex.h"