Skip to content

Update README.md

Update README.md #242

Workflow file for this run

---
#----------------------------------------------------------------------------------------
# FILENAME:
# test_formatting.yml
# DESCRIPTION:
# GitHub Actions configuration for clang-format.
# AUTHOR:
# Adam Erickson (Nervosys)
# DATE:
# 2024-02-20
# NOTES:
#
# Copyright © 2024 Nervosys, LLC
#----------------------------------------------------------------------------------------
name: "Format: Source Code"
on:
push:
branches:
- master
pull_request:
branches:
- master
types: [opened, synchronize, reopened, closed]
# workflow_dispatch:
jobs:
test-formatting-cpp:
name: "Test C/C++ Formatting"
runs-on: ubuntu-22.04
strategy:
matrix:
path:
- check: "AutonomyLib"
exclude: "^.*(json.hpp)$" # regex: glob entire file path ending in "json.hpp" match
- check: "DroneServer"
exclude: ""
- check: "DroneShell"
exclude: ""
- check: "Examples"
exclude: ""
- check: "HelloCar"
exclude: ""
- check: "HelloDrone"
exclude: ""
- check: "HelloSpawnedDrones"
exclude: ""
- check: "LogViewer"
exclude: ""
- check: "MavLinkCom"
exclude: "^.*(json.hpp)$" # regex: glob entire file path ending in "json.hpp" match
- check: "ros2"
exclude: ""
- check: "SemiGlobalMatching"
exclude: ""
- check: "Unreal"
exclude: "^.*(json.hpp)$" # regex: glob entire file path ending in "json.hpp" match
steps:
- uses: actions/checkout@v4
- name: "Run clang-format style check."
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: "17"
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
fallback-style: "LLVM" # optional
test-formatting-python:
name: "Test Python Code Formatting"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Run autopep8 style check."
uses: peter-evans/autopep8@v2
with:
args: --recursive --in-place --aggressive --aggressive ./python/
test-formatting-powershell:
name: "Test PowerShell Code Formatting"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Run PSScriptAnalyzer style check."
shell: pwsh
run: |
[Hashtable]$Settings = @{
IncludeRules = @('PSPlaceOpenBrace', 'PSUseConsistentIndentation')
Rules = @{
PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $true
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 2
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
Kind = 'space'
}
}
Severity = @('Error', 'Warning')
}
Invoke-ScriptAnalyzer -Path "./scripts" -Recurse -Settings $Settings