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.
Refactoring for nullable (microsoft#1880)
- Loading branch information
1 parent
3856d75
commit 60f7f7d
Showing
101 changed files
with
1,182 additions
and
913 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
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.Definitions; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public interface IResourceAnnotations : IDictionary<string, object> | ||
{ | ||
} |
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,30 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Definitions; | ||
|
||
/// <summary> | ||
/// Metadata about a PSRule resource. | ||
/// </summary> | ||
public interface IResourceHelpInfo | ||
{ | ||
/// <summary> | ||
/// The name of the resource. | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// A display name of the resource if set. | ||
/// </summary> | ||
string DisplayName { get; } | ||
|
||
/// <summary> | ||
/// A short description of the resource if set. | ||
/// </summary> | ||
InfoString Synopsis { get; } | ||
|
||
/// <summary> | ||
/// A long description of the resource if set. | ||
/// </summary> | ||
InfoString Description { 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,18 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Definitions; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public interface IResourceLabels : IDictionary<string, string[]> | ||
{ | ||
/// <summary> | ||
/// Check if the resource label matches. | ||
/// </summary> | ||
/// <param name="key"></param> | ||
/// <param name="value"></param> | ||
/// <returns></returns> | ||
bool Contains(string key, string[] value); | ||
} |
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,15 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Definitions; | ||
|
||
/// <summary> | ||
/// Additional resource metadata. | ||
/// </summary> | ||
public interface IResourceMetadata | ||
{ | ||
/// <summary> | ||
/// Annotations on the resource. | ||
/// </summary> | ||
public IResourceAnnotations Annotations { 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,26 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Collections; | ||
|
||
namespace PSRule.Definitions; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public interface IResourceTags : IDictionary<string, string> | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <returns></returns> | ||
Hashtable ToHashtable(); | ||
|
||
/// <summary> | ||
/// Check if a specific resource tag exists. | ||
/// </summary> | ||
/// <param name="key"></param> | ||
/// <param name="value"></param> | ||
/// <returns></returns> | ||
bool Contains(object key, object value); | ||
} |
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,42 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Definitions; | ||
|
||
/// <summary> | ||
/// A source file containing resources that will be loaded and interpreted by PSRule. | ||
/// </summary> | ||
public interface ISourceFile | ||
{ | ||
/// <summary> | ||
/// The file path to the source. | ||
/// </summary> | ||
string Path { get; } | ||
|
||
/// <summary> | ||
/// The name of the module if the source was loaded from a module. | ||
/// </summary> | ||
string Module { get; } | ||
|
||
/// <summary> | ||
/// The type of source file. | ||
/// </summary> | ||
SourceType Type { get; } | ||
|
||
/// <summary> | ||
/// The base path to use for loading help content. | ||
/// </summary> | ||
string HelpPath { get; } | ||
|
||
/// <summary> | ||
/// Determines if the source file exists. | ||
/// </summary> | ||
/// <returns>Returns <c>true</c> when the source file exists.</returns> | ||
bool Exists(); | ||
|
||
/// <summary> | ||
/// Determines if the source file is a dependency. | ||
/// </summary> | ||
/// <returns>Returns <c>true</c> when the source file is a dependency.</returns> | ||
bool IsDependency(); | ||
} |
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
File renamed without changes.
28 changes: 1 addition & 27 deletions
28
src/PSRule/Definitions/IResourceHelpInfo.cs → ...ule.Types/Definitions/ResourceHelpInfo.cs
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
Oops, something went wrong.