Git Product home page Git Product logo

ocamlformat's Introduction

OCaml Code Formatter.

OCaml-CI Build Status

ocamlformat is a code formatter for OCaml. It comes with opinionated default settings but is also fully customizable to suit your coding style.

  • Profiles: ocamlformat offers profiles we predefined formatting configurations. Profiles include default, ocamlformat, janestreet.
  • Configurable: Users can change the formatting profile and configure every option in their .ocamlformat configuration file.
  • Format Comments: ocamlformat can format comments, docstrings, and even code blocks in your comments.
  • RPC: ocamlformat provides an RPC server that can bed used by other tools to easily format OCaml Code.

ocamlformat is part of the OCaml Platform, the recommended set of tools for OCaml.

Getting Started

Installation

To use ocamlformat, you will need OCaml and opam (the OCaml package manager) installed on your system. Visit the OCaml.org installation page for instructions.

With OCaml and opam installed, you can install ocamlformat with:

opam install ocamlformat

Usage

Formatting your code is as easy as running:

ocamlformat file.ml

To configure ocamlformat to your liking, create an .ocamlformat configuration file in your project with settings like:

profile = default
version = 0.26.1

Refer to our documentation or use ocamlformat --help for a full list of configuration options.

To make formatting your code even easier, use the dune build system:

dune fmt

Documentation

The full documentation for ocamlformat, including comprehensive user and API guides, can be found on OCaml.org.

Contributing

We wholeheartedly welcome contributors! To start, please read our Contributing Guide to familiarize yourself with our development process, including how to propose and how to start hacking on ocamlformat.

In addition to the Contributing Guide, we provide a Hacking Guide for ocamlformat developers. It contains in-depth explanation of development processes, such as running tests, releasing ocamlformat, etc.

In order to foster a welcoming and respectful community, ocamlformat has adopted the OCaml Code of Conduct.

Interested in the future of ocamlformat? Take a look at our Roadmap to understand our vision and planned advancements for ocamlformat.

For conversations on ongoing development, be sure to visit the ocamlformat section of the OCaml Discuss forum.

License

ocamlformat is distributed under the terms of the MIT License. See the LICENSE file for complete details.

Acknowledgments

We gratefully acknowledge the individuals and organizations that have significantly contributed to ocamlformat.

ocamlformat owes its existance to its initial author, Josh Berdine. We also want to express our appreciation to Hugo Heuzard, Guillaume Petiot, and Jules Aguillon. Their significant contributions have been instrumental to the advancement of ocamlformat.

Moreover, our gratitude extends to Facebook, who fostered the inception of ocamlformat as part of their work on the ReasonML project. Jane Street and Tarides have also provided financial support and contributed to the ongoing development of the project.

ocamlformat's People

Contributors

gpetiot avatar hhugo avatar jberdine avatar julow avatar emillon avatar emiletrotignon avatar craigfe avatar hcarty avatar mbarbin avatar nojb avatar kit-ty-kate avatar trefis avatar tdelvecchio-jsc avatar smondet avatar avsm avatar tmattio avatar bcc32 avatar kevinji avatar panglesd avatar wilfred avatar samoht avatar rgrinberg avatar nathanreb avatar khady avatar jeremiedimino avatar xvilka avatar naartjie avatar mroch avatar mbouaziz avatar ribeirotomas1904 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.