diff --git a/build_scripts/linux/verify_formatting b/build_scripts/linux/verify_formatting new file mode 100644 index 0000000..998ae74 --- /dev/null +++ b/build_scripts/linux/verify_formatting @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +clang-format --version; + +if [ $? -eq 0 ]; then + echo "Clang-format found." + build_path="`dirname \"$0\"`" + project_path=$build_path/../.. + + python $project_path/build_scripts/run-clang-format.py $project_path/src -r --color always; + echo "FORMATTED CORRECTLY." +else + echo "Could not find clang-format." +fi + diff --git a/build_scripts/win/verify_formatting.cmd b/build_scripts/win/verify_formatting.cmd new file mode 100644 index 0000000..ad0c91a --- /dev/null +++ b/build_scripts/win/verify_formatting.cmd @@ -0,0 +1,9 @@ +@echo off +REM Arg 0 (called %0) is the full path to the file. +REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/call#batch-parameters +REM As per above link, %~dp0 expands the zeroth arg to a drive letter and path only. +REM Project dir is up two dirs from the file. +SET project_dir=%~dp0\..\..\ + +python %project_dir%/build_scripts/run-clang-format.py %project_dir%/src -r --color never --clang-format-executable %CLANG_FORMAT_LOC% +IF NOT ERRORLEVEL 1 THEN ECHO FORMATTED CORRECTLY. \ No newline at end of file