ClickHouse/utils/check-style/check-duplicate-includes.sh

7 lines
282 B
Bash
Raw Normal View History

#!/usr/bin/env bash
ROOT_PATH=$(git rev-parse --show-toplevel)
# Find duplicate include directives
2020-04-05 23:51:26 +00:00
find $ROOT_PATH/{src,base,programs,utils} -name '*.h' -or -name '*.cpp' | while read file; do grep -P '^#include ' $file | sort | uniq -c | grep -v -P '^\s+1\s' && echo $file; done