Skip to content

Refactor Connect and Disconnect functionality out to CClient #2853

Refactor Connect and Disconnect functionality out to CClient

Refactor Connect and Disconnect functionality out to CClient #2853

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@c71d0bf4e21876ebec3e5647491186f8797fde31
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 {} +