mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-26 12:37:06 +08:00
21d746e858
From CppCoreGuidelines: Rule of Zero: C.20: If you can avoid defining default operations, do. C.52: Use inheriting constructors to import constructors into a derived class that does not need further explicit initialization. DRY forward and using declarations. Miscellaneous: Fix format.sh to output examples with normalised paths in sorted order. Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
28 lines
533 B
Bash
Executable File
28 lines
533 B
Bash
Executable File
#!/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 $file ./tools/license_headers.cpp > $file.new && mv $file.new $file
|
|
fi
|
|
done
|
|
|
|
# Use clang-format.
|
|
for file in $files
|
|
do
|
|
clang-format -i $file
|
|
done
|
|
|
|
exampleList="./doc/example_list.md"
|
|
echo "# Examples" > $exampleList
|
|
files=$(find ./examples -iname "*.cpp" | sort)
|
|
for f in $files
|
|
do
|
|
echo "@example $f" >> $exampleList
|
|
done
|