Github Actions for linting the C/C++ code. Integrated clang-tidy, clang-format checks.
Just create a yml file under your GitHub repository. For example .github/workflows/cpp-linter.yml
name: cpp-linter on: [pull_request] jobs: cpp-linter: name: cpp-linter runs-on: ubuntu-latest steps: - name: C/C++ Lint Action uses: shenxianpeng/cpp-linter-action@master with: fetch-depth: 0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Here is a test repository cpp-linter-action-demo which has added cpp-linter.yml. when an unformatted c/c++ source file was committed and create a Pull Request will automatically recognize and add warning comments.
For example, this PR #7, and warning message like below:
Please feel free to commit code to the demo repo and create a Pull Request to see how the process works.
If you have any suggestions or contributions, welcome to PR here.
