papermario/.github/workflows/lint.yaml
lshamis ae66312d8c
Add Python linter to github actions (#1100)
* Add Python linter to github actions

* wip

* Add back splat_ext

* Format files

* C++ -> C

* format 2 files

* split workflow into separate file, line length 120, fix excludes

* -l 120 in ci

* update black locally and apply formatting changes

* pyproject.toject

---------

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2023-07-30 02:03:17 +09:00

36 lines
927 B
YAML

name: Lint
on:
pull_request:
jobs:
cpp_lint:
name: C format and lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Git
run: |
git log --oneline --graph --max-count=100
git log --oneline --graph --max-count=100 HEAD origin/main
- name: clang-format
run: |
git config --global color.ui always
git clang-format-14 --diff origin/main HEAD
git config --global color.ui auto
- name: Lint
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
lines-changed-only: diff
tidy-checks: ''
version: '15'
- name: Fail if lint failed
if: steps.linter.outputs.checks-failed > 0
run: exit 1