Unverified Commit 0b2952d4 authored by Yifan Xiong's avatar Yifan Xiong Committed by GitHub
Browse files

Setup - Add lint for cpp sources (#73)

__Major Revisions__

* add clang-format to lint cpp sources
* add cpp lint in GitHub Actions
parent 729e04ab
# Reference: https://clang.llvm.org/docs/ClangFormat.html
BasedOnStyle: LLVM
ColumnLimit: 120
......@@ -17,3 +17,6 @@ indent_size = 2
[*.json]
indent_size = 2
insert_final_newline = false
[{*.mk,Makefile}]
indent_style = tab
......@@ -18,3 +18,15 @@ jobs:
- name: Check spelling
run: |
misspell -error .
cpp:
name: CPP code lint
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Echo clang-format version
run: |
clang-format --version
- name: Lint
run: |
make cpplint
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
CPPSOURCES := $(shell find $(CURDIR) -regextype posix-extended -regex '.*\.(c|cpp|h|hpp|cc|cxx|cu)')
.PHONY: cpplint cppformat
cpplint:
clang-format --verbose --dry-run --Werror $(CPPSOURCES)
cppformat:
clang-format --verbose -i $(CPPSOURCES)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment