update versions, paths #240
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
#---------------------------------------------------------------------------------------- | |
# 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/[email protected] | |
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 |