check_line_endings.py 456 B

123456789101112
  1. import os
  2. skills_dir = "skills"
  3. for root, dirs, files in os.walk(skills_dir):
  4. for f in files:
  5. if f.endswith(".md"):
  6. path = os.path.join(root, f)
  7. with open(path, "rb") as file_handle:
  8. content = file_handle.read()
  9. has_crlf = b"\r\n" in content
  10. has_lf = b"\n" in content and not has_crlf
  11. print(f"{path}: CRLF={has_crlf}, LF={has_lf}, length={len(content)}")