Add automatic formatting and license.

This commit is contained in:
ArthurSonzogni
2020-04-19 21:00:37 +02:00
parent a09ebcc442
commit f506be941d
102 changed files with 423 additions and 0 deletions

19
other/format.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
cd "$(dirname "$0")"
cd ..
# Add the license file.
files=$(find ./src ./include ./examples -name "*.hpp" -o -name "*.cpp")
for file in $files
do
if ! grep -q Copyright $file
then
cat ./other/license_headers.cpp $file >$file.new && mv $file.new $file
fi
done
# Use clang-format.
for file in $files
do
clang-format -i $file
done

View File

@@ -0,0 +1,4 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.