forked from microsoft/PSRule
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Context refactoring (microsoft#2524)
- Loading branch information
1 parent
d405778
commit 1fd2d7c
Showing
12 changed files
with
109 additions
and
46 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using PSRule.Data; | ||
|
||
namespace PSRule.Pipeline; | ||
|
||
internal interface IPipelineReader | ||
{ | ||
int Count { get; } | ||
|
||
bool IsEmpty { get; } | ||
|
||
/// <summary> | ||
/// Add a new object into the stream. | ||
/// </summary> | ||
/// <param name="sourceObject">An object to process.</param> | ||
/// <param name="targetType">A pre-bound type.</param> | ||
/// <param name="skipExpansion">Determines if expansion is skipped.</param> | ||
void Enqueue(object sourceObject, string? targetType = null, bool skipExpansion = false); | ||
Check warning on line 20 in src/PSRule/Pipeline/IPipelineReader.cs GitHub Actions / Build
|
||
|
||
bool TryDequeue(out ITargetObject sourceObject); | ||
|
||
void Open(); | ||
|
||
/// <summary> | ||
/// Add a path to the list of inputs. | ||
/// </summary> | ||
/// <param name="path">The path of files to add.</param> | ||
void Add(string path); | ||
} | ||
|
||
#nullable restore |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using PSRule.Definitions; | ||
|
||
namespace PSRule.Pipeline; | ||
|
||
internal sealed class ResourceIssue | ||
{ | ||
public ResourceIssue(ResourceKind resourceKind, ResourceId resourceId, ResourceIssueType issue) | ||
{ | ||
ResourceKind = resourceKind; | ||
ResourceId = resourceId; | ||
Issue = issue; | ||
} | ||
|
||
public ResourceKind ResourceKind { get; } | ||
|
||
public ResourceId ResourceId { get; } | ||
|
||
public ResourceIssueType Issue { get; } | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Pipeline; | ||
|
||
internal enum ResourceIssueType | ||
{ | ||
Unknown, | ||
|
||
SuppressionGroupExpired | ||
} |
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
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