arapelle / bashtlk

MIT License
0 stars 0 forks source link

Add function clang-format-project #21

Open arapelle opened 9 months ago

arapelle commented 9 months ago
function clang-format-project
{
  if [[ ! -f .clang-format ]]
  then
    echo "$PWD/.clang-format does not exist."
    return 1
  fi

  for dir_to_format in include source src test tests
  do
    if [[ -d $dir_to_format ]]
    then
      find $dir_to_format -name "*.[hc]pp" | xargs clang-format.exe -i -style=file:.clang-format --verbose
    fi
  done
}
export -f clang-format-project