This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... # previous param definition | |
& { | |
... # previous class and enum definitions | |
foreach ($file in $files) { | |
$lines = Get-Content $file | |
foreach ($i in 1..$lines.Count) { | |
if ($lines[$i] -match "TODO: \(([^)]+)\) (.*)$") { | |
# parse prioritized ToDo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Push-Location $RepoRoot | |
$files = Get-ChildItem . -File -Recurse ` | |
| % FullName ` | |
| ? {$_ -ne $PSCommandPath} ` | |
| Resolve-Path -Relative | |
Pop-Location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO: \(([^)]+)\) (.*)$ | |
TODO: (.*)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO: (HIGH) Remove hard-coded secret | |
TODO: (LOW) Upgrade to LTS version | |
TODO: I think this can be cleaner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Priority { | |
Low = 3 | |
Medium = 2 | |
High = 1 | |
} | |
class ToDo { | |
[string] $FilePath | |
[Nullable[Priority]] $Priority | |
[int] $Line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
# Path to the repo containing TODO-annotated files | |
[Parameter(Mandatory)] | |
[ValidateScript({Test-Path $_ -PathType Container})] | |
[string]$RepoRoot | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method Lifecycle Name Date | |
------ --------- ---- ---- | |
Test Start Resource 1 6/12/2019 12:00:25 PM | |
Test Stop Resource 1 6/12/2019 12:00:25 PM | |
Set Start Resource 1 6/12/2019 12:00:25 PM | |
Set Stop Resource 1 6/12/2019 12:00:26 PM | |
Validate Start Resource 1 6/12/2019 12:00:26 PM | |
Validate Stop Resource 1 6/12/2019 12:00:26 PM | |
Test Start Resource 2 6/12/2019 12:00:26 PM | |
Test Stop Resource 2 6/12/2019 12:00:26 PM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$requirements | Invoke-Requirement | Format-Table -AutoSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Method {Test; Set; Validate} | |
enum Lifecycle {Start; Stop} | |
class RequirementEvent { | |
[Method] $Method | |
[Lifecycle] $Lifecycle | |
[string] $Name | |
[datetime] $Date = (Get-Date) | |
RequirementEvent($name, $method, $lifecycle) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-Requirement { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory, ValueFromPipeline)] | |
[ValidateNotNullOrEmpty()] | |
[Requirement[]]$Requirement | |
) | |
process { | |
$result = &$_.Test |