FSharpLint


Running the FAKE Task

Install the package via nuget, the nuget package contains FSharpLint.Fake.dll which provides an FSharpLint function in the namespace FSharpLint.Fake which when called will run the task.

Parameters

  • setParams - Function that can update the default options.
  • projectFile - The project file of the project you want to lint

Sample Usage

Run lint on multiple projects (here we are linting all projects with a directory in the src directory):

1: 
2: 
3: 
4: 
5: 
6: 
7: 
#I @"packages/tools/FSharpLint.Fake/tools"
#r @"packages/tools/FSharpLint.Fake/tools/FSharpLint.Fake.dll"
open FSharpLint.Fake

Target "Lint" (fun _ ->
    !! "src/**/*.fsproj"
        |> Seq.iter (FSharpLint id))

Run lint on a single project:

1: 
2: 
3: 
4: 
5: 
6: 
#I @"packages/tools/FSharpLint.Fake/tools"
#r @"packages/tools/FSharpLint.Fake/tools/FSharpLint.Fake.dll"
open FSharpLint.Fake

Target "Lint" (fun _ -> 
    FSharpLint id "src/FSharpLint.Application/FSharpLint.Application.fsproj")

Setting Options

Use the identity function to keep the default options:

1: 
FSharpLint id projectFile

For custom options, use a function that updates the options:

1: 
FSharpLint (fun options -> { options with FailBuildIfAnyWarnings = true }) projectFile
module Seq

from Microsoft.FSharp.Collections
val iter : action:('T -> unit) -> source:seq<'T> -> unit

Full name: Microsoft.FSharp.Collections.Seq.iter
val id : x:'T -> 'T

Full name: Microsoft.FSharp.Core.Operators.id
Fork me on GitHub