Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zshipko/ocamlformat-auto
Automatic ocamlformat version selection
https://github.com/zshipko/ocamlformat-auto
Last synced: about 1 month ago
JSON representation
Automatic ocamlformat version selection
- Host: GitHub
- URL: https://github.com/zshipko/ocamlformat-auto
- Owner: zshipko
- License: isc
- Created: 2022-04-01T17:28:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-17T03:13:48.000Z (almost 2 years ago)
- Last Synced: 2023-08-27T00:34:28.614Z (about 1 year ago)
- Language: OCaml
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ocamlformat-auto
`ocamlformat-auto` is an application inspired by [ocamlformat-vmux](https://github.com/CraigFe/ocamlformat-vmux)
that can be used to manage multiple versions of [ocamlformat](https://github.com/ocaml-ppx/ocamlformat)It will create an executable script named `ocamlformat` that will select the proper version for each
project.## Installation
Using [opam](https://github.com/ocaml/opam):
```shell
$ opam pin add git+https://github.com/zshipko/ocamlformat-auto.git
```Using [dune](https://dune.build):
```shell
$ dune exec ./main.exe init
```## Typical usage
In the root of an existing project (with an `.ocamlformat` file) you can run the following
to ensure the proper `ocamlformat` version is installed and `ocamlformat` will work as
expected:```shell
$ ocamlformat-auto install --init
```## More examples
Initialize the shim:
```shell
$ ocamlformat-auto init
```Install the detected version (or latest if no .ocamlformat file is present):
```shell
$ ocamlformat-auto install
```Install a specific version:
```shell
$ ocamlformat-auto install 0.20.0
```List installed versions:
```shell
$ ocamlformat-auto list
```Execute ocamlformat on a file (this will try to detect the correct version
by checking the `.ocamlformat` file for your project):```shell
$ ocamlformat-auto exec -- ./bin/main.ml -i
```Once the installed (using the `init` command), you can run `ocamlformat`
like normal and the correct version will automatically be selected:```shell
$ ocamlformat ./bin/main.ml -i
```For more information run `ocamlformat-auto --help`