alejandro5042 / azdo-userscripts

A collection of userscripts to improve the Azure DevOps UI
https://alejandro5042.github.io/azdo-userscripts/
MIT License
40 stars 23 forks source link

Align known_issues.json match_flag field with pipeline-csv.ps1 #189

Closed marcpage closed 1 year ago

marcpage commented 2 years ago

This script uses the known-issues.json file owned by the pipeline-csv.ps1 script. The match_flag behavior is different than the script. This PR fixes that.

The pipeline-csv.ps1 script prepends the match with (?m) if match_flag is equal to multiline and if it isn't, it prepends the match with (?s) if match_flag equals dotmatchall. If the match_all field doesn't match either then the flags used are not modified.

        if ($item.match_flag -eq "multiline") {
            $item.match = "(?m)$($item.match)"
        }
        elseif ($item.match_flag -eq "dotmatchall") {
            $item.match = "(?s)$($item.match)"
        }

...

    foreach ($def in $definitions) {
        if ($def.name -match $defRegex) {
            $defIds += $def.id
            Write-Host "$($def.name)"
        }
    }

In javascript, the equivalent of:

welcome[bot] commented 2 years ago

Thanks for opening this pull request! Please check out our contributing guidelines.