Script that goes through your C/C++ project and finds sources which include standard headers before including local headers.
You may then consider reordering these.
Why? Because importing standard headers first may mask missing imports in your own local headers and sources and they otherwise may stop compiling if the order changes or if somebody uses them in another code.
The script does not modify any files.
$ python localimporter.py --root /home/user/exciting-project
/home/user/exciting-project/src/this.hpp
/home/user/exciting-project/src/that.h
/home/user/exciting-project/src/another.cpp
/home/user/exciting-project/src/somelib.c
/home/user/exciting-project/src/main.cpp
$ python localimporter.py --root /home/user/exciting-project --suffixes "['hpp']"
/home/user/exciting-project/src/this.hpp
$ python localimporter.py --help
Usage: localimporter.py [OPTIONS]
Options:
--root TEXT Directory root under which the script will search files.
--suffixes TEXT List of suffixes to search, default: ['h', 'hpp', 'c',
'cpp'].
--help Show this message and exit.