How to run cpplint recursively for nested directories using glob pattern
If you're using Google's original cpplinter then its difficult to support glob pattern on python version < 3. Google does not maintain the cpplinter. As there are many open PR. There is a Forked of Google's cpplinter which address most of the missing features from the original version and is actively maintained. Once you switch to the Forked version then you can pass
--recursiveflag to traverse files recursively. For example,
Solution 1 [For Mac / *nix based systems Only]
$python <path_to_cpplint.py> --recursive */*
*/*glob pattern tells it to traverse all the nested files.
Solution 2 [ For Windows and *nix based systems ]
$python <path_to_cpplint.py> --recursive <path_to_dir_where_you_want_to_run_linter_recursively>
will lint all three files nested inside
$python <path_to_cpplint.py> --recursive bar
bardirectory. This approach works on the Mac / *nix based systems, too.