check if the file is c/c++ before formatting