Fast bash script to check source code for basic textual anomalies

It can be convenient to check source code for some basic textual anomalies in an automated fashion.
The bash script below is a simple example of this in case of C++ code, utilizating mostly basic unix programs like grep.
This approach appears to be very fast. The include-guard check is by far the slowest, as it cannot utilize the xargs feature passing multiple filenames to grep at the same time.
Still, on a moderate source code base it is all done in a matter of seconds.

Leave a Reply

Your email address will not be published. Required fields are marked *