improve format check for source files