File: format_code.sh

package info (click to toggle)
libkiwix 14.0.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,508 kB
  • sloc: cpp: 20,712; javascript: 5,743; python: 476; xml: 318; ansic: 84; sh: 24; makefile: 7
file content (14 lines) | stat: -rwxr-xr-x 300 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/bash

# Compute 'src' path
SCRIPT_DIR=$(dirname "$0")
REPO_DIR=$(readlink -f "$SCRIPT_DIR"/..)
DIRS="src include"

# Apply formating to all *.cpp and *.h files
cd "$REPO_DIR"
for FILE in $(find $DIRS -name '*.h' -o -name '*.cpp')
do
  echo $FILE
  clang-format -i -style=file "$FILE"
done