checkIntegrity :: Bool -> FilePath -> FileSystem -> IO [String]
checkIntegrity isRoot tplDir fs = do
  tplCheck <- getTplErrors tplDir $ rootLabel fs
  childrenErrors <- mapM (checkIntegrity False tplDir) $ subForest fs
  let nameCheck = getNameErrors isRoot $ rootLabel fs
      errors    = concat [nameCheck, tplCheck, concat childrenErrors]
  return errors

-- Format list of errors to a string with a visual list of errors.
checkIntegrity :: Bool -> FilePath -> FileSystem -> IO [String]
checkIntegrity isRoot tplDir fs = do
  tplCheck <- getTplErrors tplDir $ rootLabel fs
  childrenErrors <- mapM (checkIntegrity False tplDir) $ subForest fs
  let nameCheck = getNameErrors isRoot $ rootLabel fs
      errors    = concat [nameCheck, tplCheck, concat childrenErrors]
  return errors

-- Format list of errors to a string with a visual list of errors.
checkIntegrity isRoot tplDir fs = do
  tplCheck <- getTplErrors tplDir $ rootLabel fs
  childrenErrors <- mapM (checkIntegrity False tplDir) $ subForest fs
  let nameCheck = getNameErrors isRoot $ rootLabel fs
      errors    = concat [nameCheck, tplCheck, concat childrenErrors]
  return errors

-- Format list of errors to a string with a visual list of errors.