mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-11 17:00:22 +00:00
Co-authored-by: Olli Saarikivi <olsaarik@microsoft.com> Co-authored-by: Changho Hwang <changhohwang@microsoft.com> Co-authored-by: Binyang Li <binyli@microsoft.com>
63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
|
|
jobs:
|
|
cpplint:
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install ClangFormat
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang-format
|
|
|
|
- name: Run cpplint
|
|
run: |
|
|
CPPSOURCES=$(find ./ -regextype posix-extended -regex '.*\.(c|cpp|h|hpp|cc|cxx|cu)' -not -path "./build/*")
|
|
clang-format -style=file --verbose --Werror --dry-run ${CPPSOURCES}
|
|
|
|
pylint:
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install Python dependencies
|
|
run: python3.8 -m pip install black
|
|
|
|
- name: Run linters
|
|
uses: wearerequired/lint-action@v2
|
|
with:
|
|
black: true
|
|
black_auto_fix: false
|
|
black_args: "--config pyproject.toml --check"
|
|
|
|
spelling:
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Download misspell
|
|
run: |
|
|
curl -L https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_linux_64bit.tar.gz -o /tmp/misspell_0.3.4_linux_64bit.tar.gz
|
|
tar -xzf /tmp/misspell_0.3.4_linux_64bit.tar.gz -C .
|
|
|
|
- name: Check spelling
|
|
run: |
|
|
./misspell -error .
|