Skip to content

Merge pull request #3260 from AdamGLIN/customDirectoriesButton #136

Merge pull request #3260 from AdamGLIN/customDirectoriesButton

Merge pull request #3260 from AdamGLIN/customDirectoriesButton #136

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@v4
- name: Check .cpp/.h/.mm with clang-format
uses: DoozyX/clang-format-lint-action@11b773b1598aa4ae3b32f023701bca5201c3817d
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@v4
- 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@v4
- name: Install pylint
run: pip install --user "pylint < 3.0"
- name: Check Python files with pylint
run: find ./tools -name '*.py' -print -exec pylint {} +