Skip to content

Commit

Permalink
[chore](clang-format)(license-eye) Add Clang Format/Skywalking eyes g…
Browse files Browse the repository at this point in the history
…ithub action (apache#7132)

1. The clang format action will be triggered when a PR is submitted.
2. Skywalking eyes actions will be triggered when a PR is submitted and after merging to master branch.
  • Loading branch information
morningman authored Nov 24, 2021
1 parent 3b98820 commit e74bfea
Show file tree
Hide file tree
Showing 11 changed files with 587 additions and 283 deletions.
9 changes: 9 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Please add code that you don’t want to be formatted by clang here

be/src/gutil/*
be/src/glibc-compatibility/*
be/src/util/sse2neo.h
be/src/util/sse2neon.h
be/src/util/mustache/mustache.h
be/src/util/mustache/mustache.cc
be/src/util/utf8_check.cpp
35 changes: 35 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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.
#

---
name: BE Code Fomatter
on: pull_request
jobs:
clang-format:
name: "Clang Fomatter"
runs-on: ubuntu-latest
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
- name: "Format it!"
uses: DoozyX/[email protected]
id: be_clang_format
with:
source: 'be/src be/test'
clangFormatVersion: 10
inplace: False
35 changes: 35 additions & 0 deletions .github/workflows/license-eyes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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.
#
---
name: License Check
on:
pull_request:
push:
branches:
- master
jobs:
license-check:
name: "License Check"
runs-on: ubuntu-latest
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
- name: Check License
uses: apache/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ header:
- 'NOTICE'
- 'DISCLAIMER'
- '.clang-format'
- '.clang-format-ignore'
- '.gitattributes'
- '.gitignore'
- '.gitmodules'
Expand Down Expand Up @@ -48,5 +49,6 @@ header:
- 'be/src/util/sse2neo.h'
- 'be/src/util/sse2neon.h'
- 'be/src/util/utf8_check.cpp'
- 'build-support/run_clang_format.py'

comment: on-failure
34 changes: 33 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -543,4 +543,36 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

--------------------------------------------------------------------------------

build-support/run_clang_format.py: MIT license

This script is copied from:
https://github.com/DoozyX/clang-format-lint-action/blob/master/run-clang-format.py

which is a wrapper script around clang-format, suitable for linting multiple files
and to use for continuous integration.

MIT License

Copyright (c) 2019 Slobodan Kletnikov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion build-support/check-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export DORIS_HOME=`cd "${ROOT}/.."; pwd`

CLANG_FORMAT=${CLANG_FORMAT_BINARY:=$(which clang-format)}

python3 ${DORIS_HOME}/build-support/run_clang_format.py --clang_format_binary="${CLANG_FORMAT}" --source_dirs="${DORIS_HOME}/be/src,${DORIS_HOME}/be/test" --quiet
python3 ${DORIS_HOME}/build-support/run_clang_format.py "--clang-format-executable" "${CLANG_FORMAT}" "-r" "--style" "file" "--inplace" "false" "--extensions" "c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx" "--exclude" "none" "be/src be/test"

2 changes: 1 addition & 1 deletion build-support/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ export DORIS_HOME=`cd "${ROOT}/.."; pwd`

CLANG_FORMAT=${CLANG_FORMAT_BINARY:=$(which clang-format)}

python3 ${DORIS_HOME}/build-support/run_clang_format.py --clang_format_binary="${CLANG_FORMAT}" --fix --source_dirs="${DORIS_HOME}/be/src","${DORIS_HOME}/be/test"
python3 ${DORIS_HOME}/build-support/run_clang_format.py "--clang-format-executable" "${CLANG_FORMAT}" "-r" "--style" "file" "--inplace" "true" "--extensions" "c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx" "--exclude" "none" "be/src be/test"


111 changes: 0 additions & 111 deletions build-support/lintutils.py

This file was deleted.

Loading

0 comments on commit e74bfea

Please sign in to comment.