Skip to content

ROS Style Guide C++ Format

Actions
Formats using clang in ROS Stlye and commits changes
v1.0.1
Latest
Star (3)

ROS C++ Style Guide Github Action

Github Action applying the ROS Style Guide to C++ code.

This Action will format the code to match the ROS C++ Style Guide using clang-format-3.8 with the configuration from davetcoleman/roscpp_code_format.

It is required to add this to formatter.yml that runs on push after a build is successful and ready for a pull request. Github Actions triggered by pull request unfortunately have a detached head and do not allow committing to the same branch.

Features

  • formats C++ code to match the ROS Style guide
  • Commits modified code to branch
  • Supports push triggers (not pull requests)
  • Future Enhancement: Pass custom .clang-format file

Usage

name: Code Formatter
on:
  push:
jobs:
  clang-format:
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v2
      - uses: AutoModality/action-ros-clang-format@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Optional

From action.yml

inputs:
  author-name:
    description: 'The name that will appear in commits when changes needs to be committed'
    required: false
    default: Format Bot
  author-email:
    description: 'The email address that will appear in commits when changes needs to be committed'
    required: false
    default: [email protected]
  commit-message:
    description: 'The commit message used when changes needs to be committed'
    required: false
    default: 'style: Applied ROS C++ Style Guide'

ROS Style Guide C++ Format is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Formats using clang in ROS Stlye and commits changes
v1.0.1
Latest

ROS Style Guide C++ Format is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.