-
Notifications
You must be signed in to change notification settings - Fork 225
63 lines (58 loc) · 1.79 KB
/
coding-style-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Coding Style Check
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- '**.cpp'
- '**.h'
- '**.mm'
- '**.sh'
- '**.py'
pull_request:
branches: [ main ]
paths:
- '**.cpp'
- '**.h'
- '**.mm'
- '**.sh'
- '**.py'
permissions:
contents: read
jobs:
check-c-like-style:
name: Verify C-like coding style
# As this action runs with minimal permissions and does not influence the build output,
# we perform no version pinning for the runner or the installed tools here.
# The clangFormatVersion is based on Ubuntu current LTS (jammy at time of writing).
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check .cpp/.h/.mm with clang-format
uses: DoozyX/clang-format-lint-action@a83a8fb7d371f66da7dd1c4f33a193023899494b
with:
clangFormatVersion: 14
# When updating the extension list, remember to update
# Jamulus.pro's CLANG_SOURCES as well and the paths: in 'on:' list above.
extensions: 'cpp,h,mm'
check-bash-style:
name: Verify shell script (Bash) coding style
runs-on: ubuntu-latest
# shellcheck is already pre-installed on ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check .sh with shellcheck
run: find -name '*.sh' -not -path './libs/*' -exec shellcheck --shell=bash {} +
- name: Install shfmt
run: sudo snap install shfmt
- name: Check .sh with shfmt
run: shfmt -d .
check-python-style:
name: Verify Python coding style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pylint
run: pip install --user "pylint < 3.0"
- name: Check Python files with pylint
run: find ./tools -name '*.py' -print -exec pylint {} +