Skip to content

Instantly share code, notes, and snippets.

@s-trooper
Last active January 23, 2019 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-trooper/86e918c92b257d50a3a5 to your computer and use it in GitHub Desktop.
Save s-trooper/86e918c92b257d50a3a5 to your computer and use it in GitHub Desktop.
program interaction with the world

FSharpFormat

F# source code formatter, similar to C# formatter in Visual Studio. It formats spacing and indentations. In oposite to Fantomas it doesn't rearrange source code by adding or removing newlines. Also one of goals of the project is not to break an existing code and as a reference test to leave intact VisualFsharp Project after formatting.

Prerequisites

In order to build or run this tool you will need to have .NET Core (SDK) installed.

Installation

  1. dotnet pack
  2. dotnet tool install --global --add-source ./.nupkg fsfmt

Usage

In order get the usage, simply invoke the tool with no arguments:

$ fsfmt
Usage: fsfmt [OPTION] SOURCE
Formats the SOURCE. If SOURCE is a folder then formats all .fs files within it.
If there is no defined OUTPUT then writes the formatted source code back to the SOURCE.

Options:
 -r, --recurse     Processes the input folder recursively
     --stdout      Writes the formatted source code to the standard output
 -o, --out <FILE>  Writes the formatted source code into <FILE>
 -h, --help        Displays this information

License

This project is subject to the Apache 2.0 License. A copy of this license can be found in License file at the root of this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment