From c70082de9ce2012df537e40392d11a3767352eb4 Mon Sep 17 00:00:00 2001 From: "Zhang, Chaojun" Date: Fri, 3 Mar 2023 12:51:49 +0000 Subject: [PATCH] feat(lint): Add lint to CI include checking for cmake-format,clang-forma and license header --- .github/workflows/build_test.yml | 17 +++++++++++++++++ .licenserc.yaml | 17 +++++++++++------ src/substrait/proto/update_proto_package.pl | 1 + src/substrait/textplan/SymbolTable.cpp | 1 + 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index c1b14dac..b9e5a44a 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 name: Ubuntu Build & Test on: @@ -7,6 +8,22 @@ on: branches: [main] jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Setup Ubuntu + run: ./scripts/setup-ubuntu.sh + - name: Check License Header + uses: apache/skywalking-eyes/header@v0.4.0 + - name: Check CMake files + run: find . \( -name '*.cmake' -o -name 'CMakeLists.txt' \) -exec cmake-format $* {} + + - name: Clang-tidy + run: python3 scripts/run-clang-tidy.py "." "build" "third_party,scripts,docker,cmake_modules" "h,hpp,cc,cpp" + - run: mkdir build build: runs-on: ubuntu-latest diff --git a/.licenserc.yaml b/.licenserc.yaml index 133a7114..f8967cf3 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -1,13 +1,18 @@ header: license: spdx-id: Apache-2.0 - copyright-owner: Apache Software Foundation + content: | + SPDX-License-Identifier: Apache-2.0 paths-ignore: - - 'dist' - - 'licenses' + - '.github' + - '.gitignore' + - '.gitmodules' + - '.clang-format' + - '.clang-tidy' + - '.licenserc.yaml' - '**/*.md' - - 'LICENSE' - - 'NOTICE' + - '**/*.json' + - '**/*.log' - comment: on-failure \ No newline at end of file + comment: never \ No newline at end of file diff --git a/src/substrait/proto/update_proto_package.pl b/src/substrait/proto/update_proto_package.pl index 259f035c..d9eb0bba 100755 --- a/src/substrait/proto/update_proto_package.pl +++ b/src/substrait/proto/update_proto_package.pl @@ -1,4 +1,5 @@ #!/bin/perl -w +# SPDX-License-Identifier: Apache-2.0 # Renames package declarations for protobuffers from substrait to substrait.proto. # This allows us to modify where the generated C++ have their definitions without diff --git a/src/substrait/textplan/SymbolTable.cpp b/src/substrait/textplan/SymbolTable.cpp index ad3bf30d..446f9bea 100644 --- a/src/substrait/textplan/SymbolTable.cpp +++ b/src/substrait/textplan/SymbolTable.cpp @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: Apache-2.0 */ #include #include #include