Skip to content

Commit

Permalink
Add uncrustify settings to devcontainer.json and format_code.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
mempler committed Dec 16, 2023
1 parent 7712ca9 commit 12e72c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@
},
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"settings": {
"uncrustify.configPath.linux": "uncrustify.cfg",
"uncrustify.executablePath.linux": "./prebuilt/linux/uncrustify"
}
}
},
"features": {}
}
Binary file added prebuilt/linux-x86/bin/uncrustify
Binary file not shown.
11 changes: 11 additions & 0 deletions tools/format_code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

UNCRUSTIFY=prebuilt/linux-x86/bin/uncrustify
UNCRUSTIFY_CONFIG=uncrustify.cfg

if [ ! -f $UNCRUSTIFY ]; then
echo "uncrustify not found, this should be run from the root of the project"
exit 1
fi

find . -name "*.h" -o -name "*.cpp" -o -name "*.c" -o -name "*.hpp" | xargs $UNCRUSTIFY -c $UNCRUSTIFY_CONFIG --replace --no-backup

0 comments on commit 12e72c1

Please sign in to comment.