blob: 02cfad2bdaa3d6aac57a49d4f5c573f15fff5c69 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#!/bin/bash
################################################################################
#
# Author: Alejandro Colomar Andrés
#
# This script checks the style in all files of type (.c .cpp .h .hpp) in the
# selected dirs.
#
################################################################################
# variables #
################################################################################
dirs=(
../
)
################################################################################
# functions #
################################################################################
check_style()
{
./checkpatch.pl --show-types --no-tree -f $1 \
--ignore SPDX_LICENSE_TAG,IF_0,SPACING,BRACKET_SPACE
}
find_source_files()
{
source_files=$(find $1 -type f \( -iname \*.c -o -iname \*.h -o -iname \*.cpp -o -iname \*.hpp \))
}
################################################################################
# main #
################################################################################
for i in ${dirs[*]}
do
find_source_files ${i}
for j in ${source_files}
do
check_style ${j}
done
done
################################################################################
# end of file #
################################################################################
|