Use AStyle to keep the code clean.

Issue #7 resolved
Robert Massaioli repo owner created an issue

The options to run probably look something like this:

astyle --style="allman" --indent-switches --indent-namespaces --indent-classes --pad-oper --add-brackets **/*.cpp **/*.h

And on your local machine you should make that a pre-commit hook.

Comments (4)

  1. Robert Massaioli reporter

    There is even a git pre-commit hook that makes sure that I do not mess up:

    #!/bin/sh -e
    
    echo "Running AStyle before commit"
    ASTYLE=${ASTYLE:-astyle}
    case `$ASTYLE --version 2> /dev/null` in
      Artistic*)
          ;;
      default)
          echo "fuppes git pre-commit hook:"
          echo "Did not find astyle, please install it before continuing."
          exit 1
          ;;
    esac
    
    bash scripts/run_astyle.bash "--formatted"
    echo "Successfully ran astyle before commit."
    
    exit 0
    

    You should use this in the documentation.

  2. Log in to comment