Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/nuget/YamlDotNet-16.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite committed Oct 24, 2024
2 parents 1eed098 + 9c6b007 commit 6c1cb5d
Show file tree
Hide file tree
Showing 224 changed files with 3,347 additions and 3,070 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"isRoot": true,
"tools": {
"gitversion.tool": {
"version": "5.12.0",
"version": "6.0.3",
"commands": [
"dotnet-gitversion"
],
"rollForward": false
}
}
}
}
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ indent_size = 2
# Code style defaults
csharp_using_directive_placement = outside_namespace:error
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
dotnet_sort_system_directives_first = true
dotnet_sort_system_directives_first = true:error
dotnet_style_readonly_field = true:suggestion
csharp_style_namespace_declarations = file_scoped:error
dotnet_diagnostic.IDE0005.severity = error

# License header
file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
Expand Down
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ updates:
- dependencies
reviewers:
- microsoft/psrule
groups:
# Group PowerShell packages that have inter-dependencies
dev-powershell:
patterns:
- System.Management.Automation
- Microsoft.PowerShell.SDK

# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
timeout-minutes: 5
run: Invoke-Build -Configuration Release -AssertStyle GitHubActions

- name: Lint .NET
shell: pwsh
timeout-minutes: 5
run: dotnet format --verify-no-changes

- name: Upload module
uses: actions/upload-artifact@v4
with:
Expand Down
17 changes: 12 additions & 5 deletions PSRule.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32602.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Types", "src\PSRule.Types\PSRule.Types.csproj", "{5FE4DB0B-63D1-4DDB-9762-9C0D29168BC9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Badges", "src\PSRule.Badges\PSRule.Badges.csproj", "{309BED8B-4E60-4C42-A2B4-37A2E7EBEF3F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule", "src\PSRule\PSRule.csproj", "{0130215D-58EB-4887-B6FA-31ED02500569}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Benchmark", "src\PSRule.Benchmark\PSRule.Benchmark.csproj", "{3EC0912F-BFC7-4B53-A1A1-0BA993C6282E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Tests", "tests\PSRule.Tests\PSRule.Tests.csproj", "{D3488CE2-779F-4474-B38A-F894A4B689F7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Badges", "src\PSRule.Badges\PSRule.Badges.csproj", "{309BED8B-4E60-4C42-A2B4-37A2E7EBEF3F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.BuildTool", "src\PSRule.BuildTool\PSRule.BuildTool.csproj", "{20DDCC65-8A9A-4BDC-91EC-C3BE6F32E52E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.SDK", "src\PSRule.SDK\PSRule.SDK.csproj", "{07A84E67-1CA3-4766-B9EA-1FDD9DF6516F}"
Expand All @@ -22,8 +24,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
src\PSRule.Common.props = src\PSRule.Common.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Types", "src\PSRule.Types\PSRule.Types.csproj", "{5FE4DB0B-63D1-4DDB-9762-9C0D29168BC9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.MSBuild", "src\PSRule.MSBuild\PSRule.MSBuild.csproj", "{872D2648-2F00-475E-84B5-F08BE07385B7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{E0EA0CBA-96C5-4447-8B69-BC13EF0D7A4A}"
Expand All @@ -32,7 +32,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Tool.Tests", "tests\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.CommandLine", "src\PSRule.CommandLine\PSRule.CommandLine.csproj", "{9A556814-8E9D-4C76-8F6D-1AF2DA23A9E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSRule.CommandLine.Tests", "tests\PSRule.CommandLine.Tests\PSRule.CommandLine.Tests.csproj", "{C25E2FC1-E306-4D99-925C-15E5DD51F6A2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.CommandLine.Tests", "tests\PSRule.CommandLine.Tests\PSRule.CommandLine.Tests.csproj", "{C25E2FC1-E306-4D99-925C-15E5DD51F6A2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSRule.Types.Tests", "tests\PSRule.Types.Tests\PSRule.Types.Tests.csproj", "{34095F78-CDA3-4E72-B64C-6366EA4B3EAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -88,6 +90,10 @@ Global
{C25E2FC1-E306-4D99-925C-15E5DD51F6A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C25E2FC1-E306-4D99-925C-15E5DD51F6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C25E2FC1-E306-4D99-925C-15E5DD51F6A2}.Release|Any CPU.Build.0 = Release|Any CPU
{34095F78-CDA3-4E72-B64C-6366EA4B3EAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34095F78-CDA3-4E72-B64C-6366EA4B3EAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34095F78-CDA3-4E72-B64C-6366EA4B3EAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34095F78-CDA3-4E72-B64C-6366EA4B3EAF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -96,6 +102,7 @@ Global
{D3488CE2-779F-4474-B38A-F894A4B689F7} = {E0EA0CBA-96C5-4447-8B69-BC13EF0D7A4A}
{DA46C891-08F1-4D01-9F98-1F8BB10CAFEC} = {E0EA0CBA-96C5-4447-8B69-BC13EF0D7A4A}
{C25E2FC1-E306-4D99-925C-15E5DD51F6A2} = {E0EA0CBA-96C5-4447-8B69-BC13EF0D7A4A}
{34095F78-CDA3-4E72-B64C-6366EA4B3EAF} = {E0EA0CBA-96C5-4447-8B69-BC13EF0D7A4A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {533491EB-BAE9-472E-B57F-A675ECD335B5}
Expand Down
34 changes: 34 additions & 0 deletions docs/CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,30 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers

## Unreleased

## v3.0.0-B0275 (pre-release)

What's changed since pre-release v3.0.0-B0267:

- New features:
- Allow CLI upgrade command to upgrade a single module by @BernieWhite.
[#2551](https://github.com/microsoft/PSRule/issues/2551)
- A single or specific modules can be upgraded by name when using `module upgrade`.
- By default, all modules are upgraded.
- Allow CLI to install pre-release modules by @BernieWhite.
[#2550](https://github.com/microsoft/PSRule/issues/2550)
- Add and upgrade pre-release modules with `--prerelease`.
- Pre-release modules will be restored from the lock file with `module restore`.
- General improvements:
- **Breaking change**: Empty version comparison only accepts stable versions by default by @BernieWhite.
[#2557](https://github.com/microsoft/PSRule/issues/2557)
- `version` and `apiVersion` assertions only accept stable versions by default for all cases.
- Pre-release versions can be accepted by setting `includePrerelease` to `true`.
- Bug fixes:
- Fixed CLI upgrade uses pre-release module by @BernieWhite.
[#2549](https://github.com/microsoft/PSRule/issues/2549)

## v3.0.0-B0267 (pre-release)

What's changed since pre-release v3.0.0-B0203:

- New features:
Expand All @@ -37,6 +61,12 @@ What's changed since pre-release v3.0.0-B0203:
- The `Execution.Break` option can be set to `Never`, `OnError`, `OnWarning`, or `OnInformation`.
- If a rule fails with a severity level equal or higher than the configured level the pipeline will break.
- General improvements:
- **Breaking change**: Improve scope handling for correctly handling cases with multiple module by @BernieWhite.
[#1215](https://github.com/microsoft/PSRule/issues/1215)
- As a result of this change:
- The `binding` property can no longer be used within baselines.
- Custom inline script blocks can no longer be used for custom binding.
- Use module configuration or workspace to configure binding options instead.
- Added support for native logging within emitters by @BernieWhite.
[#1837](https://github.com/microsoft/PSRule/issues/1837)
- Engineering:
Expand All @@ -59,6 +89,10 @@ What's changed since pre-release v3.0.0-B0203:
- Bug fixes:
- Fixed CLI exception the term Find-Module is not recognized by @BernieWhite.
[#1860](https://github.com/microsoft/PSRule/issues/1860)
- Fixed aggregation of reasons with `$Assert.AnyOf()` by @BernieWhite.
[#1829](https://github.com/microsoft/PSRule/issues/1829)
- Added `Problem` to validate sets of `OutputOutcome` by @nightroman
[#2542](https://github.com/microsoft/PSRule/issues/2542)

## v3.0.0-B0203 (pre-release)

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/PSRule/en-US/Assert-PSRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Evaluate items and additionally save the results into a variable `resultRecords`

### -InputPath

Instead of processing objects from the pipeline, import objects file the specified file paths.
Instead of processing objects from the pipeline, import objects from the specified file paths.

```yaml
Type: String[]
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/PSRule/en-US/Get-PSRuleTarget.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Get target objects from `resources.json`.

### -InputPath

Instead of processing objects from the pipeline, import objects file the specified file paths.
Instead of processing objects from the pipeline, import objects from the specified file paths.

```yaml
Type: String[]
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/PSRule/en-US/Invoke-PSRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ Accept wildcard characters: False

### -InputPath

Instead of processing objects from the pipeline, import objects file the specified file paths.
Instead of processing objects from the pipeline, import objects from the specified file paths.

```yaml
Type: String[]
Expand Down
66 changes: 5 additions & 61 deletions docs/commands/PSRule/en-US/New-PSRuleOption.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Create options to configure PSRule execution.

```text
New-PSRuleOption [[-Path] <String>] [-Configuration <ConfigurationOption>]
[-SuppressTargetName <SuppressionOption>] [-BindTargetName <BindTargetName[]>]
[-BindTargetType <BindTargetName[]>] [-BaselineGroup <Hashtable>] [-BindingIgnoreCase <Boolean>]
[-SuppressTargetName <SuppressionOption>]
[-BaselineGroup <Hashtable>] [-BindingIgnoreCase <Boolean>]
[-BindingField <Hashtable>] [-BindingNameSeparator <String>] [-BindingPreferTargetInfo <Boolean>]
[-TargetName <String[]>] [-TargetType <String[]>] [-BindingUseQualifiedName <Boolean>]
[-Convention <String[]>] [-DuplicateResourceId <ExecutionActionPreference>]
Expand All @@ -44,8 +44,8 @@ New-PSRuleOption [[-Path] <String>] [-Configuration <ConfigurationOption>]

```text
New-PSRuleOption [-Option] <PSRuleOption> [-Configuration <ConfigurationOption>]
[-SuppressTargetName <SuppressionOption>] [-BindTargetName <BindTargetName[]>]
[-BindTargetType <BindTargetName[]>] [-BaselineGroup <Hashtable>] [-BindingIgnoreCase <Boolean>]
[-SuppressTargetName <SuppressionOption>]
[-BaselineGroup <Hashtable>] [-BindingIgnoreCase <Boolean>]
[-BindingField <Hashtable>] [-BindingNameSeparator <String>] [-BindingPreferTargetInfo <Boolean>]
[-TargetName <String[]>] [-TargetType <String[]>] [-BindingUseQualifiedName <Boolean>]
[-Convention <String[]>] [-DuplicateResourceId <ExecutionActionPreference>]
Expand All @@ -71,7 +71,7 @@ New-PSRuleOption [-Option] <PSRuleOption> [-Configuration <ConfigurationOption>]

```text
New-PSRuleOption [-Default] [-Configuration <ConfigurationOption>] [-SuppressTargetName <SuppressionOption>]
[-BindTargetName <BindTargetName[]>] [-BindTargetType <BindTargetName[]>] [-BaselineGroup <Hashtable>]
[-BaselineGroup <Hashtable>]
[-BindingIgnoreCase <Boolean>] [-BindingField <Hashtable>] [-BindingNameSeparator <String>]
[-BindingPreferTargetInfo <Boolean>] [-TargetName <String[]>] [-TargetType <String[]>]
[-BindingUseQualifiedName <Boolean>] [-Convention <String[]>]
Expand Down Expand Up @@ -118,28 +118,6 @@ Create an options object that suppresses `TestObject1` and `TestObject3` for a r

### Example 3

```powershell
# Create a custom function that returns a TargetName string
$bindFn = {
param ($TargetObject)
$otherName = $TargetObject.PSObject.Properties['OtherName'];
if ($otherName -eq $Null) {
return $Null
}
return $otherName.Value;
}
# Specify the binding function script block code to execute
$option = New-PSRuleOption -BindTargetName $bindFn;
```

Creates an options object that uses a custom function to bind the _TargetName_ of an object.

### Example 4

```powershell
$option = New-PSRuleOption -Configuration @{ 'appServiceMinInstanceCount' = 2 };
```
Expand Down Expand Up @@ -221,23 +199,6 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -BindTargetName

Configures a custom function to use to bind TargetName of an object.
See about_PSRule_Options for more information.

```yaml
Type: BindTargetName[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Configuration

Configures a set of baseline configuration values that can be used in rule definitions instead of using hard coded values.
Expand Down Expand Up @@ -274,23 +235,6 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -BindTargetType

Configures a custom function to use to bind TargetType of an object.
See about_PSRule_Options for more information.

```yaml
Type: BindTargetName[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -BindingIgnoreCase

Sets the option `Binding.IgnoreCase`.
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/PSRule/en-US/Test-PSRuleTarget.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Accept wildcard characters: False

### -InputPath

Instead of processing objects from the pipeline, import objects file the specified file paths.
Instead of processing objects from the pipeline, import objects from the specified file paths.

```yaml
Type: String[]
Expand Down
Loading

0 comments on commit 6c1cb5d

Please sign in to comment.