Checks that a path is formatted.
@return new text of file if it needs formatting or null otherwise.
function checkFile(path) {
  const formatter = path.match(/\.md$/) ? prettierFormat : clangFormat;
  const source = fs.readFileSync(path, 'utf8');
  const formatted = formatter(path, source);
  if (source !== formatted) {
    return formatted;
  }
  return null;
}