Inaky Perez-Gonzalez | 8ddf82c | 2015-04-10 16:44:37 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Yonattan Louise | cfd8417 | 2015-04-15 14:04:16 -0500 | [diff] [blame] | 3 | # |
| 4 | # Copyright (c) 2015 Intel Corporation. |
| 5 | # |
David B. Kinder | ac74d8b | 2017-01-18 17:01:01 -0800 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
Yonattan Louise | cfd8417 | 2015-04-15 14:04:16 -0500 | [diff] [blame] | 7 | # |
| 8 | |
Inaky Perez-Gonzalez | 8ddf82c | 2015-04-10 16:44:37 -0700 | [diff] [blame] | 9 | [ -f $1 ] && rm $1 |
| 10 | [ -f $1_error.types ] && rm $1_error.types |
| 11 | [ -f $1_warning.types ] && rm $1_warning.types |
| 12 | |
| 13 | dirs_to_check="arch drivers include kernel lib" |
| 14 | files=$(for d in ${dirs_to_check}; do find $d/ -type f -name '*.[ch]'; done) |
| 15 | for i in $files; do |
Anas Nashif | b882377 | 2015-06-05 22:46:00 -0400 | [diff] [blame] | 16 | ${ZEPHYR_BASE}/scripts/checkpatch.pl --mailback --no-tree -f --emacs --summary-file --show-types --ignore BRACES,PRINTK_WITHOUT_KERN_LEVEL,SPLIT_STRING --max-line-length=100 $i >> $1 |
Inaky Perez-Gonzalez | 8ddf82c | 2015-04-10 16:44:37 -0700 | [diff] [blame] | 17 | done |
| 18 | grep ERROR: $1 |cut -d : -f 3,4 |sort -u > $1_error.types |
| 19 | grep WARNING: $1 |cut -d : -f 3,4 |sort -u > $1_warning.types |
| 20 | for i in `cat $1_error.types`; do |
| 21 | echo -n $i ' '; grep $i $1 | wc -l |
| 22 | done |
| 23 | for i in `cat $1_warning.types`; do |
| 24 | echo -n $i ' '; grep $i $1 | wc -l |
| 25 | done |