A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://fsprojects.github.io/FSharpLint/how-tos/msbuild-task.html below:

FSharpLint | Setup MSBuild Task

Setup MSBuild Task

FSharpLint can be run as an MSBuild task; this will result in lint warnings showing up in your IDE (Visual Studio/Rider).

To set this up, first install the FSharpLint dotnet tool.

Then, you can add the following to any of your projects to run linting after build completion for that project:

<Target Name="FSharpLint" AfterTargets="BeforeBuild" Condition="'$(DesignTimeBuild)' != 'true'">
 <Exec
   Command="dotnet fsharplint -f msbuild lint --lint-config $(MSBuildThisFileDirectory)/fsharplint.json $(MSBuildProjectFullPath)"
   ConsoleToMsBuild="true"
   IgnoreExitCode="false"
 />
</Target>

If you would like to enable linting for all projects, you can add the following target to either a Directory.Build.props or Directory.Build.targets file in the root of your repository. This will add the target to all F# projects. See here for more info

<Target Name="FSharpLint" AfterTargets="BeforeBuild" Condition="'$(MSBuildProjectExtension)'=='.fsproj' AND '$(DesignTimeBuild)' != 'true'">
 <Exec
   Command="dotnet fsharplint -f msbuild lint --lint-config $(MSBuildThisFileDirectory)/fsharplint.json $(MSBuildProjectFullPath)"
   ConsoleToMsBuild="true"
   IgnoreExitCode="false"
 />
</Target>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4