1+ < html class ="js csstransforms3d ">
2+ < head >
3+ < meta charSet ="utf-8 "/>
4+ < meta name ="viewport " content ="width=device-width, initial-scale=1 "/>
5+ < title >
6+ FSharpLint | Setup MSBuild Task
7+ </ title >
8+ < link rel ="icon " type ="image/png " sizes ="32x32 " href ="https://fsprojects.github.io/FSharpLint/static/images/favicon.png "/>
9+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/nucleus.css "/>
10+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/fontawesome-all.min.css "/>
11+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/hybrid.css "/>
12+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/featherlight.min.css "/>
13+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/perfect-scrollbar.min.css "/>
14+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/auto-complete.css "/>
15+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/atom-one-dark-reasonable.css "/>
16+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/theme.css "/>
17+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/custom.css "/>
18+ < link rel ="stylesheet " href ="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/styles/atom-one-dark.min.css "/>
19+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/css/theme-blue.css "/>
20+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/jquery-3.3.1.min.js "> </ script >
21+ </ head >
22+ < body >
23+ < nav id ="sidebar ">
24+ < div id ="header-wrapper ">
25+ < div id ="header ">
26+ < h2 id ="logo ">
27+ FSharpLint
28+ </ h2 >
29+ </ div >
30+ < div class ="searchbox ">
31+ < label for ="search-by ">
32+ < i class ="fas fa-search "> </ i >
33+ </ label >
34+ < input data-search-input ="" id ="search-by " type ="search " placeholder ="Search... "/>
35+ < span data-search-clear ="">
36+ < i class ="fas fa-times "> </ i >
37+ </ span >
38+ </ div >
39+ < script type ="text/javascript " src ="https://fsprojects.github.io/FSharpLint/static/js/lunr.min.js "> </ script >
40+ < script type ="text/javascript " src ="https://fsprojects.github.io/FSharpLint/static/js/auto-complete.js "> </ script >
41+ < script type ="text/javascript ">
42+ var baseurl = 'https://fsprojects.github.io/FSharpLint'
43+ </ script >
44+ < script type ="text/javascript " src ="https://fsprojects.github.io/FSharpLint/static/js/search.js "> </ script >
45+ </ div >
46+ < div class ="highlightable ">
47+ < ul class ="topics ">
48+ < li class ="dd-item ">
49+ < a href ="https://fsprojects.github.io/FSharpLint " class ="">
50+ Overview
51+ </ a >
52+ </ li >
53+ < li class ="dd-item parent ">
54+ < a class ="active ">
55+ How-To Guides
56+ </ a >
57+ < ul class ="child ">
58+ < li class ="dd-item ">
59+ < a href ="https://fsprojects.github.io/FSharpLint/how-tos/install-dotnet-tool.html " class ="">
60+ Install Dotnet Tool
61+ </ a >
62+ </ li >
63+ < li class ="dd-item ">
64+ < a href ="https://fsprojects.github.io/FSharpLint/how-tos/msbuild-task.html " class ="active ">
65+ Setup MSBuild Task
66+ </ a >
67+ </ li >
68+ < li class ="dd-item ">
69+ < a href ="https://fsprojects.github.io/FSharpLint/how-tos/rule-configuration.html " class ="">
70+ Rule Config
71+ </ a >
72+ </ li >
73+ < li class ="dd-item ">
74+ < a href ="https://fsprojects.github.io/FSharpLint/how-tos/rule-suppression.html " class ="">
75+ Rule Suppression
76+ </ a >
77+ </ li >
78+ </ ul >
79+ </ li >
80+ < li class ="dd-item parent ">
81+ < a class ="">
82+ API References
83+ </ a >
84+ < ul class ="child ">
85+ < li class ="dd-item ">
86+ < a href ="https://fsprojects.github.io/FSharpLint/reference/FSharpLint.Core/index.html " class ="">
87+ FSharpLint.Core
88+ </ a >
89+ </ li >
90+ </ ul >
91+ </ li >
92+ </ ul >
93+ < section id ="shortcuts ">
94+ < h3 >
95+ Shortcuts
96+ </ h3 >
97+ < ul >
98+ < li >
99+ < a class ="padding " href ="/ ">
100+ < i class ="fas fa-home "> </ i >
101+ Home
102+ </ a >
103+ </ li >
104+ < li >
105+ < a class ="padding " href ="http://github.com/fsprojects/FSharpLint ">
106+ < i class ="fab fa-github "> </ i >
107+ GitHub repo
108+ </ a >
109+ </ li >
110+ </ ul >
111+ </ section >
112+ < section id ="footer ">
113+ < p > Built with < a href ="https://github.com/ionide/Fornax "> Fornax</ a >
114+ </ section >
115+ </ div >
116+ </ nav >
117+ < section id ="body ">
118+ < div id ="overlay "> </ div >
119+ < div class ="padding highlightable ">
120+ < div id ="body-inner ">
121+ < span id ="sidebar-toggle-span ">
122+ < a href ="# " id ="sidebar-toggle " data-sidebar-toggle ="">
123+ < i class ="fas fa-bars "> </ i >
124+ navigation
125+ </ a >
126+ </ span >
127+ < h1 > Setup MSBuild Task</ h1 >
128+ < p > FSharpLint can be run as an MSBuild task; this will result in lint warnings showing up in your IDE (Visual Studio/Rider).</ p >
129+ < p > To set this up, first < a href ="install-dotnet-tool.html "> install the FSharpLint dotnet tool</ a > .</ p >
130+ < p > Then, you can add the following to any of your projects to run linting after build completion for that project:</ p >
131+ < pre > < code > <Target Name="FSharpLint" AfterTargets="BeforeBuild" Condition="'$(DesignTimeBuild)' != 'true'">
132+ <Exec
133+ Command="dotnet fsharplint -f msbuild lint --lint-config $(MSBuildThisFileDirectory)/fsharplint.json $(MSBuildProjectFullPath)"
134+ ConsoleToMsBuild="true"
135+ IgnoreExitCode="false"
136+ />
137+ </Target>
138+ </ code > </ pre >
139+ < p > If you would like to enable linting for all projects, you can add the following target to either a < code > Directory.Build.props</ code > or < code > Directory.Build.targets</ code > file in the root of your repository. This will add the target to all F# projects. See < a href ="https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019 "> here</ a > for more info</ p >
140+ < pre > < code > <Target Name="FSharpLint" AfterTargets="BeforeBuild" Condition="'$(MSBuildProjectExtension)'=='.fsproj' AND '$(DesignTimeBuild)' != 'true'">
141+ <Exec
142+ Command="dotnet fsharplint -f msbuild lint --lint-config $(MSBuildThisFileDirectory)/fsharplint.json $(MSBuildProjectFullPath)"
143+ ConsoleToMsBuild="true"
144+ IgnoreExitCode="false"
145+ />
146+ </Target>
147+ </ code > </ pre >
148+
149+ </ div >
150+ </ div >
151+ </ section >
152+ < div style ="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px; ">
153+ < div style ="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px; "> </ div >
154+ </ div >
155+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/clipboard.min.js "> </ script >
156+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/perfect-scrollbar.min.js "> </ script >
157+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/perfect-scrollbar.jquery.min.js "> </ script >
158+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/jquery.sticky.js "> </ script >
159+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/featherlight.min.js "> </ script >
160+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/modernizr.custom-3.6.0.js "> </ script >
161+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/learn.js "> </ script >
162+ < script src ="https://fsprojects.github.io/FSharpLint/static/js/hugo-learn.js "> </ script >
163+ < link rel ="stylesheet " href ="https://fsprojects.github.io/FSharpLint/static/mermaid/mermaid.css "/>
164+ < script src ="https://fsprojects.github.io/FSharpLint/static/mermaid/mermaid.js "> </ script >
165+ < script >
166+ mermaid . initialize ( { startOnLoad : true } ) ;
167+ </ script >
168+ < script src ="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/highlight.min.js "> </ script >
169+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/languages/fsharp.min.js "> </ script >
170+ < script >
171+ hljs . initHighlightingOnLoad ( )
172+ </ script >
173+ </ body >
174+ </ html >
0 commit comments