Skip to content

Comments

feat: add ppx_forbid to enforce Eio-safe coding rules#118

Merged
mathiasbourgoin merged 1 commit intomainfrom
feat/ppx-forbid
Feb 18, 2026
Merged

feat: add ppx_forbid to enforce Eio-safe coding rules#118
mathiasbourgoin merged 1 commit intomainfrom
feat/ppx-forbid

Conversation

@mathiasbourgoin
Copy link
Collaborator

Summary

  • Add ppx_forbid as a build dependency
  • Create .ppx_forbid config forbidding unsafe patterns in an Eio-based TUI framework:
    • Obj module (breaks type safety)
    • Blocking I/O: Unix.sleep/sleepf, Unix.open_process_*, Unix.system
    • Blocking threads: Thread.create/delay
    • Direct stdout/stderr: print_endline, print_string, prerr_endline, etc.
  • Enable ppx_forbid across all 20 src/ libraries
  • Annotate all legitimate existing uses with [@allow_forbidden "reason"]

Test plan

  • dune build — clean, no ppx_forbid errors
  • dune runtest — all tests pass
  • dune fmt — formatting applied

Add ppx_forbid as a build dependency and enable it across all source
libraries. The .ppx_forbid config forbids Obj, blocking Unix/Thread
calls, and direct stdout/stderr writes — all patterns that break in
an Eio-based TUI framework. Existing legitimate uses are annotated
with [@allow_forbidden "reason"].
@mathiasbourgoin mathiasbourgoin merged commit cf03f2e into main Feb 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant