cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
utils/check-style/check-ungrouped-includes.sh
8lines · modecode
| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | ROOT_PATH=$(git rev-parse --show-toplevel) |
| 4 | |
| 5 | # Find files with includes not grouped together by first component of path |
| 6 | find $ROOT_PATH/dbms -name '*.h' -or -name '*.cpp' | while read file; do |
| 7 | [[ $(grep -oP '^#include <\w+' $file | uniq -c | wc -l) > $(grep -oP '^#include <\w+' $file | sort | uniq -c | wc -l) ]] && echo $file && grep -oP '^#include <\w+' $file | uniq -c; |
| 8 | done |