<commit_before>Set-StrictMode -version 2

# Modified from
# http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/
function UnzipFile($file, $destination) {
	mkdir $destination >$null
	$file = (Resolve-Path $file)[0].Path
	$destination = (Resolve-Path $destination)[0].Path

	echo ('Extracting ' + $file + ' => ' + $destination)

	if (Get-Command "7z.exe" -ErrorAction SilentlyContinue) {
		7z x -y "-o$destination" $file
	} else {
		$shell = new-object -com shell.application
		$zip = $shell.NameSpace($file)
		foreach ($item in $zip.items()) {
			$shell.Namespace($destination).copyhere($item)
		}
	}
}

$doxygen_dir = '.\doxygen'
$doxygen_zip = $doxygen_dir + '.zip'
$doxygen_exists = Test-Path $doxygen_dir
if ($doxygen_exists -ne $true) {
	$doxygen_zip_exists = Test-path $doxygen_zip
	if ($doxygen_zip_exists -ne $true) {
		echo 'Downloading doxygen...'
		Invoke-WebRequest ftp://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.8.windows.bin.zip -OutFile $doxygen_zip
	}

	UnzipFile $doxygen_zip $doxygen_dir
}

&$doxygen_dir\doxygen.exe .\Doxyfile 2>&1 | %{
	if ($_.gettype().Name -eq "ErrorRecord") {
		if ($_ -match 'warning:') {
			$Host.UI.WriteWarningLine($_)
		} else {
			$Host.UI.WriteErrorLine($_)
		}
	} else {
		echo $_
	}
}
if ($LastExitCode -ne 0) {
	Throw "doxygen completed with errors."
}<commit_msg>Convert Doxygen warning messages to AppVeyor warnings.<commit_after>Set-StrictMode -version 2

# Modified from
# http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/
function UnzipFile($file, $destination) {
	mkdir $destination >$null
	$file = (Resolve-Path $file)[0].Path
	$destination = (Resolve-Path $destination)[0].Path

	echo ('Extracting ' + $file + ' => ' + $destination)

	if (Get-Command "7z.exe" -ErrorAction SilentlyContinue) {
		7z x -y "-o$destination" $file
	} else {
		$shell = new-object -com shell.application
		$zip = $shell.NameSpace($file)
		foreach ($item in $zip.items()) {
			$shell.Namespace($destination).copyhere($item)
		}
	}
}

$doxygen_dir = '.\doxygen'
$doxygen_zip = $doxygen_dir + '.zip'
$doxygen_exists = Test-Path $doxygen_dir
if ($doxygen_exists -ne $true) {
	$doxygen_zip_exists = Test-path $doxygen_zip
	if ($doxygen_zip_exists -ne $true) {
		echo 'Downloading doxygen...'
		Invoke-WebRequest ftp://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.8.windows.bin.zip -OutFile $doxygen_zip
	}

	UnzipFile $doxygen_zip $doxygen_dir
}

&$doxygen_dir\doxygen.exe .\Doxyfile 2>&1 | %{
	if ($_.gettype().Name -eq "ErrorRecord") {
		if ($_ -match 'warning:') {
			if (Get-Command 'Add-AppveyorCompilationMessage' -errorAction SilentlyContinue) {
				$match = Select-String -InputObject $_ -Pattern '^([A-Za-z]:[^:]+):([\d]+): warning: (.*)$'
				$file = $match.Matches.Groups[1].Value
				$line = [System.Convert]::ToInt32($match.Matches.Groups[2].Value)
				$message = $match.Matches.Groups[3].Value
				Add-AppveyorCompilationMessage -Message $message -Category 'Documentation' Warning -FileName $file -Line $line
			}
			$Host.UI.WriteWarningLine($_)
		} else {
			$Host.UI.WriteErrorLine($_)
		}
	} else {
		echo $_
	}
}
if ($LastExitCode -ne 0) {
	Throw "doxygen completed with errors."
}
{'fraction_non_alphanumeric': 0.17081626221241727, 'fraction_numerical': 0.008509297195083518, 'mean_word_length': 4.102893890675241, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1138836', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1172, 'n_words': 227}