#!/bin/bash

set -e

if [[ -n "${CI}" ]]; then
    set -x
fi

function usage() {
    echo -n \
        "Usage: $(basename "$0")
Format code with yapf
"
}

DIRS_TO_CHECK=("drivecycle" "tests" "scripts")

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
    if [ "${1:-}" = "--help" ]; then
        usage
    else
        # Code formatting
        yapf -ipr ${DIRS_TO_CHECK[@]}
    fi
fi
