mirror of
https://bitbucket.org/smil3y/katana.git
synced 2025-02-23 18:32:47 +00:00
stylish.sh: a script to format source code via astyle
This commit is contained in:
parent
548fa47b03
commit
dcc731d37a
1 changed files with 25 additions and 0 deletions
25
stylish.sh
Executable file
25
stylish.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cwd="$(pwd)"
|
||||||
|
|
||||||
|
if ! type -p astyle ;then
|
||||||
|
echo "astyle is not installed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
packs=("kdelibs" "kde-baseapps" "kde-workspace" "kde-extraapps")
|
||||||
|
|
||||||
|
source "$(dirname $0)/fetch.sh"
|
||||||
|
|
||||||
|
for p in "${packs[@]}";do
|
||||||
|
echo "Adjusting formatting of $p..."
|
||||||
|
cd "$cwd/$p"
|
||||||
|
# git reset --hard HEAD
|
||||||
|
astyle --style=1tbs --convert-tabs --indent=spaces=4 --verbose \
|
||||||
|
$(find -type f -name '*.c' -o -name '*.cc' -o -name '*.cpp' \
|
||||||
|
-o -name '*.h' -o -name '*.hh' -o -name '*.hpp')
|
||||||
|
cd "$cwd"
|
||||||
|
git clean -f
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue