1
0
mirror of https://github.com/blawar/ooot.git synced 2024-06-30 16:29:55 +00:00
ooot/format.sh
Anghelo Carvajal 4d5d1fd079
Add every unreserved object in an automated way (#805)
* it's crashing

* fix stuff

* fix xmls

* problematic objects

* fix tabs

* Fix suffixes

* add missing new lines

* Add comments to the problematic objects

* Find and replace fixes

* Add Fig's objects

* I forgot to add a Name in a cutscene, so I'm adding it here

* Update object decomp tutorial a little bit

* Update problematic objects

* Update docs/tutorial/object_decomp.md

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>

* Change comments

* comment out a few blobs

* dammit tluts

* Change a bunch of objects

* update the last bunch

* update comments on  oA11 and oB2

* Ninja-edit to fix compatibility with ZAPD's PR 142

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
2021-05-16 12:36:40 -04:00

30 lines
953 B
Bash
Executable File

#!/usr/bin/env bash
FORMAT_OPTS="-i -style=file"
TIDY_OPTS="-p . --fix --fix-errors"
COMPILER_OPTS="-fno-builtin -std=gnu90 -Iinclude -Isrc -D_LANGUAGE_C -DNON_MATCHING"
shopt -s globstar
if (( $# > 0 )); then
echo "Formatting file(s) $*"
echo "Running clang-format..."
clang-format ${FORMAT_OPTS} "$@"
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
sed -i -e '$a\' "$@"
echo "Done formatting file(s) $*"
exit
fi
echo "Formatting C files. This will take a bit"
echo "Running clang-format..."
clang-format ${FORMAT_OPTS} src/**/*.c
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
find assets/xml/ -type f -name "*.xml" -exec sed -i -e '$a\' {} \;
echo "Done formatting all files."