summaryrefslogtreecommitdiffstats
path: root/Checkstyle/checkstyle
blob: 6ce8be9d492a18a48b30367b61d19f83f6c05a42 (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
53
54
55
#!/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=(
	../src/
	../inc/
	../stm32l4-modules/
	../libalx/
)


################################################################################
#	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							       #
################################################################################