Add verification scripts for clang-format
The scripts are very light on error handling and verification, mostly intended just to debug if a CI server fails on formatting reasons.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user