CodeCommitsIssuesPull requestsActionsInsightsSecurity
e3ed311273f8c9905a658148f852b3c2188c4795

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

utils/check-style/check-ungrouped-includes.sh

8lines · modecode

1#!/usr/bin/env bash
2
3ROOT_PATH=$(git rev-parse --show-toplevel)
4
5# Find files with includes not grouped together by first component of path
6find $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;
8done