<commit_before>﻿/// Contains a task which can be used to run [DotCover](http://www.jetbrains.com/dotcover/) on .NET assemblies.
module Fake.DotCover

open Fake
open System
open System.IO
open System.Text

type DotCoverReportType = 
  | Html = 0
  | Json = 1
  | Xml = 2
  | NDependXml = 3

/// The DotCover parameter type for running coverage
type DotCoverParams = 
    { ToolPath: string
      WorkingDir: string
      TargetExecutable: string
      TargetArguments: string
      TargetWorkingDir: string
      Output: string
      Filters: string }

/// The DotCover defaeult parameters
let DotCoverDefaults = 
    { ToolPath = findToolInSubPath "dotcover.exe" (currentDirectory @@ "tools" @@ "DotCover")
      WorkingDir = ""
      TargetExecutable = ""
      TargetArguments = ""
      TargetWorkingDir = ""
      Output = "DotCover.snapshot"
      Filters = "" }

type DotCoverMergeParams = 
    { ToolPath: string
      WorkingDir: string
      Source: string list
      Output: string
      TempDir: string }

let DotCoverMergeDefaults =
     { ToolPath = findToolInSubPath "dotcover.exe" (currentDirectory @@ "tools" @@ "DotCover")
       WorkingDir = ""
       Source = []
       Output = "DotCover.snapshot"
       TempDir = "" }

type DotCoverReportParams = 
    { ToolPath: string
      WorkingDir: string
      Source: string
      Output: string
      ReportType: DotCoverReportType }
      
let DotCoverReportDefaults : DotCoverReportParams =
     { ToolPath = findToolInSubPath "dotcover.exe" (currentDirectory @@ "tools" @@ "DotCover")
       WorkingDir = ""
       Source = ""
       Output = "DotCover.xml"
       ReportType = DotCoverReportType.Xml }

let buildDotCoverArgs parameters =
    new StringBuilder()
    |> append "cover"
    |> appendIfNotNullOrEmpty parameters.TargetExecutable "/TargetExecutable="
    |> appendIfNotNullOrEmpty (parameters.TargetArguments.Trim()) "/TargetArguments="
    |> appendIfNotNullOrEmpty parameters.TargetWorkingDir "/TargetWorkingDir="
    |> appendIfNotNullOrEmpty parameters.Output "/Output="
    |> toText

let buildDotCoverMergeArgs (parameters:DotCoverMergeParams) =
    new StringBuilder()
    |> append "merge"
    |> appendIfNotNullOrEmpty (parameters.Source |> String.concat ";") "/Source="
    |> appendIfNotNullOrEmpty parameters.Output "/Output="
    |> appendIfNotNullOrEmpty parameters.TempDir "/TempDir="
    |> toText
    
let buildDotCoverReportArgs parameters =
    new StringBuilder()
    |> append "report"
    |> appendIfNotNullOrEmpty parameters.Source "/Source="
    |> appendIfNotNullOrEmpty parameters.Output "/Output="
    |> appendIfNotNullOrEmpty (parameters.ReportType.ToString()) "/ReportType="
    |> toText
<commit_msg>add missing /Filters argument to the dotCover command line<commit_after>﻿/// Contains a task which can be used to run [DotCover](http://www.jetbrains.com/dotcover/) on .NET assemblies.
module Fake.DotCover

open Fake
open System
open System.IO
open System.Text

type DotCoverReportType = 
  | Html = 0
  | Json = 1
  | Xml = 2
  | NDependXml = 3

/// The DotCover parameter type for running coverage
type DotCoverParams = 
    { ToolPath: string
      WorkingDir: string
      TargetExecutable: string
      TargetArguments: string
      TargetWorkingDir: string
      Output: string
      Filters: string }

/// The DotCover defaeult parameters
let DotCoverDefaults = 
    { ToolPath = findToolInSubPath "dotcover.exe" (currentDirectory @@ "tools" @@ "DotCover")
      WorkingDir = ""
      TargetExecutable = ""
      TargetArguments = ""
      TargetWorkingDir = ""
      Output = "DotCover.snapshot"
      Filters = "" }

type DotCoverMergeParams = 
    { ToolPath: string
      WorkingDir: string
      Source: string list
      Output: string
      TempDir: string }

let DotCoverMergeDefaults =
     { ToolPath = findToolInSubPath "dotcover.exe" (currentDirectory @@ "tools" @@ "DotCover")
       WorkingDir = ""
       Source = []
       Output = "DotCover.snapshot"
       TempDir = "" }

type DotCoverReportParams = 
    { ToolPath: string
      WorkingDir: string
      Source: string
      Output: string
      ReportType: DotCoverReportType }
      
let DotCoverReportDefaults : DotCoverReportParams =
     { ToolPath = findToolInSubPath "dotcover.exe" (currentDirectory @@ "tools" @@ "DotCover")
       WorkingDir = ""
       Source = ""
       Output = "DotCover.xml"
       ReportType = DotCoverReportType.Xml }

let buildDotCoverArgs parameters =
    new StringBuilder()
    |> append "cover"
    |> appendIfNotNullOrEmpty parameters.TargetExecutable "/TargetExecutable="
    |> appendIfNotNullOrEmpty (parameters.TargetArguments.Trim()) "/TargetArguments="
    |> appendIfNotNullOrEmpty parameters.TargetWorkingDir "/TargetWorkingDir="
    |> appendIfNotNullOrEmpty parameters.Filters "/Filters="
    |> appendIfNotNullOrEmpty parameters.Output "/Output="
    |> toText

let buildDotCoverMergeArgs (parameters:DotCoverMergeParams) =
    new StringBuilder()
    |> append "merge"
    |> appendIfNotNullOrEmpty (parameters.Source |> String.concat ";") "/Source="
    |> appendIfNotNullOrEmpty parameters.Output "/Output="
    |> appendIfNotNullOrEmpty parameters.TempDir "/TempDir="
    |> toText
    
let buildDotCoverReportArgs parameters =
    new StringBuilder()
    |> append "report"
    |> appendIfNotNullOrEmpty parameters.Source "/Source="
    |> appendIfNotNullOrEmpty parameters.Output "/Output="
    |> appendIfNotNullOrEmpty (parameters.ReportType.ToString()) "/ReportType="
    |> toText

{'fraction_non_alphanumeric': 0.10198915009041591, 'fraction_numerical': 0.0014466546112115732, 'mean_word_length': 3.32109375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1654911', 'n_tokens_mistral': 1653, 'n_tokens_neox': 1493, 'n_words': 379}