GithubHelp home page GithubHelp logo

patricoferris / ocamlformat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ocaml-ppx/ocamlformat

0.0 2.0 0.0 9.16 MB

Auto-formatter for OCaml code

License: MIT License

Makefile 0.34% Emacs Lisp 0.95% OCaml 87.42% Shell 0.40% Standard ML 0.95% Perl 0.68% Pawn 8.60% Raku 0.67%

ocamlformat's Introduction

Build Status

OCamlFormat

Hello, new user! Welcome! ๐Ÿ‘‹

If you are here, you are probably interested in using a formatting tool for your code base, so that you do not have to worry about formatting it by hand, and to speed up code review by focusing on the important parts.

OCamlFormat is probably what you are after!

OCamlFormat works by parsing then outputting again the same OCaml source file in a consistent style.

Read the documentation to learn more about OCamlFormat!

Getting started

Installation

OCamlFormat can be installed with opam:

opam install ocamlformat

Alternatively, see ocamlformat.opam for manual build instructions.

Formatting code!

Setting up your project to use the default profile and the OCamlFormat version you installed (hopefully the last one) in this .ocamlformat file is considered good practice:

profile = default
version = 0.21.0

To manually invoke OCamlformat the general command is:

ocamlformat [OPTION]... [SRC]...

See ocamlformat --help or man ocamlformat for the detail about options.

You can also view it online.

The most common usecase involves using the dune build system, once your project is correctly setup (see Dune's manual) you can reformat your project using:

dune build @fmt

Community

See CONTRIBUTING for how to help out.

License

OCamlFormat is MIT-licensed.

ocamlformat's People

Contributors

gpetiot avatar hhugo avatar jberdine avatar julow avatar emillon avatar craigfe avatar hcarty avatar mbarbin avatar smondet avatar trefis avatar nojb avatar kit-ty-kate avatar bcc32 avatar avsm avatar tmattio avatar jeremiedimino avatar khady avatar nathanreb avatar wilfred avatar panglesd avatar naartjie avatar mroch avatar mbouaziz avatar oscarlahaie avatar rbjorklin avatar rgrinberg avatar giltho avatar smorimoto avatar samoht avatar chrismamo1 avatar

Watchers

James Cloos avatar  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.