Skip to content

Commit 2009317

Browse files
webwarrior-wsknocte
authored andcommitted
Core: refactoring to make SelfCheck succeed
Use property initialization instead of property mutation as suggested by FavourNonMutablePropertyInitialization rule.
1 parent 6374317 commit 2009317

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

  • src/FSharpLint.Core/Application

src/FSharpLint.Core/Application/Lint.fs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,18 @@ module Lint =
261261
ReachedEnd(fileInfo.File, fileWarnings |> Seq.toList) |> lintInfo.ReportLinterProgress
262262

263263
let private runProcess (workingDir:string) (exePath:string) (args:string) =
264-
let psi = System.Diagnostics.ProcessStartInfo()
265-
psi.FileName <- exePath
266-
psi.WorkingDirectory <- workingDir
267-
psi.RedirectStandardOutput <- true
268-
psi.RedirectStandardError <- true
269-
psi.Arguments <- args
270-
psi.CreateNoWindow <- true
271-
psi.UseShellExecute <- false
272-
273-
use p = new System.Diagnostics.Process()
274-
p.StartInfo <- psi
264+
let psi =
265+
System.Diagnostics.ProcessStartInfo(
266+
FileName = exePath,
267+
WorkingDirectory = workingDir,
268+
RedirectStandardOutput = true,
269+
RedirectStandardError = true,
270+
Arguments = args,
271+
CreateNoWindow = true,
272+
UseShellExecute = false
273+
)
274+
275+
use p = new System.Diagnostics.Process(StartInfo = psi)
275276
let sbOut = System.Text.StringBuilder()
276277
p.OutputDataReceived.Add(fun ea -> sbOut.AppendLine(ea.Data) |> ignore)
277278
let sbErr = System.Text.StringBuilder()

0 commit comments

Comments
 (0)