Skip to content

Commit cdda91f

Browse files
committed
feat(ci): self check the solution
1 parent b09e3f9 commit cdda91f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

build/Properties/launchSettings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"commandName": "Project",
1717
"commandLineArgs": "--target BuildDocs"
1818
},
19+
"SelfCheck": {
20+
"commandName": "Project",
21+
"commandLineArgs": "--target SelfCheck"
22+
},
1923
"Release": {
2024
"commandName": "Project",
2125
"commandLineArgs": "--target Release 0.24.2"

build/build.fs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ let releaseBranch = "main"
6969
let readme = "README.md"
7070
let changelogFile = "CHANGELOG.md"
7171

72+
// fsharplint:disable FL0046
7273
let READMElink = Uri (Uri (gitHubRepoUrl), $"blob/{releaseBranch}/{readme}")
7374
let CHANGELOGlink = Uri (Uri (gitHubRepoUrl), $"blob/{releaseBranch}/{changelogFile}")
75+
// fsharplint:enable FL0046
7476

7577
let changelogPath = rootDirectory </> changelogFile
7678

@@ -155,12 +157,14 @@ module dotnet =
155157
let fantomas args = DotNet.exec id "fantomas" args
156158

157159
module FSharpAnalyzers =
160+
// fsharplint:disable FL0041
158161
type Arguments =
159162
| Project of string
160163
| Analyzers_Path of string
161164
| Fail_On_Warnings of string list
162165
| Ignore_Files of string list
163166
| Verbose
167+
// fsharplint:enable FL0041
164168

165169
interface IArgParserTemplate with
166170
member s.Usage = ""
@@ -563,6 +567,16 @@ let watchDocs ctx =
563567
let configuration = configuration (ctx.Context.AllExecutingTargets)
564568
DocsTool.watch (string configuration)
565569

570+
let selfCheck _ =
571+
let srcDir = rootDirectory </> "src"
572+
let consoleProj = srcDir </> "FSharpLint.Console"
573+
let sol = sln
574+
575+
DotNet.exec
576+
(fun opts -> { opts with WorkingDirectory = consoleProj })
577+
"run"
578+
$"lint %s{sol}"
579+
|> failOnBadExitAndPrint
566580

567581
let initTargets (ctx : Context.FakeExecutionContext) =
568582
BuildServer.install [ GitHubActions.Installer ]
@@ -614,6 +628,7 @@ let initTargets (ctx : Context.FakeExecutionContext) =
614628
Target.create "CleanDocsCache" cleanDocsCache
615629
Target.create "BuildDocs" buildDocs
616630
Target.create "WatchDocs" watchDocs
631+
Target.create "SelfCheck" selfCheck
617632

618633
//-----------------------------------------------------------------------------
619634
// Target Dependencies

0 commit comments

Comments
 (0)