package file-rewriter
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=bcc2177b21daf06d379806045cab266ef9017968645dd8fb445594222e0f1d07
sha512=e7c546d98d1b0da412d63366cce777cc50a24f89c60ce9af67bb6698e6c12a620480daaefb5e186d6d5daf6143ac2b65a6f26a8daea0588055cfcfef90c13401
Description
File_rewriter is an OCaml library for applying small rewrites to tweak or refactor your files.
It provides a convenient interface to apply surgical textual substitutions on the fly, while navigating the contents of a file through an abstract representation containing code locations.
It can be a great fit for applying systematic codemods to a large codebase.
README
file-rewriter
File-rewriter is an OCaml library for applying small rewrites to tweak or refactor your files. It provides a convenient interface to apply surgical textual substitutions on the fly, while navigating the contents of a file through an abstract representation containing code locations.
Other libraries
The repository also contain sexps_rewriter, a specialized version of the main library dedicated to rewriting sexp files.
Motivation
We created these libraries as part of an ongoing work to create linting and refactoring tools for the many dune files found in big monorepos (see dunolint).
Acknowledgments
We've been inspired by this blog post.
In particular, we've reused the idea of registering substitutions while itering through the locations of an AST. While we didn't reuse any particular project or existing code for our libraries, we're thankful to Jeremie Dimino and Jane Street for the work and technics discussed in their blog post.
Dependencies (5)
Dev Dependencies (1)
-
odoc
with-doc
Optional Dependencies
None
Used by (3)
Conflicts
None
Build status
Results of building file-rewriter with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.0.3 (this version) | n/a | n/a | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure