Skip to content

Commit 68a7978

Browse files
authored
Merge branch 'main' into bewhite/repo-config
2 parents 4f6ae81 + 5462f35 commit 68a7978

320 files changed

Lines changed: 23024 additions & 7715 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azure-pipelines/azure-pipelines.yaml

Lines changed: 29 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,19 @@
22
# CI pipeline for PSRule
33

44
variables:
5-
version: '2.1.0'
5+
version: '2.5.0'
66
buildConfiguration: 'Release'
77
disable.coverage.autogenerate: 'true'
8-
imageName: 'ubuntu-20.04'
8+
imageName: 'ubuntu-22.04'
99

10-
# Use build number format, i.e. 2.1.0-B2203001
10+
# Use build number format, i.e. 2.5.0-B2203001
1111
name: $(version)-B$(date:yyMM)$(rev:rrr)
1212

1313
trigger:
1414
branches:
1515
include:
1616
- 'main'
1717
- 'release/*'
18-
# tags:
19-
# include:
20-
# - 'v1.*'
21-
# - 'v2.*'
2218

2319
pr:
2420
branches:
@@ -115,7 +111,7 @@ stages:
115111

116112
- job: Secret_Scan
117113
pool:
118-
vmImage: 'windows-2019'
114+
vmImage: 'windows-2022'
119115
displayName: Secret scan
120116

121117
steps:
@@ -142,84 +138,48 @@ stages:
142138

143139
- template: jobs/test.yaml
144140
parameters:
145-
name: ubuntu_20_04_coverage
146-
imageName: 'ubuntu-20.04'
141+
name: ubuntu_22_04_coverage
142+
imageName: 'ubuntu-22.04'
147143
displayName: 'PowerShell coverage'
148144
coverage: 'true'
149145
publishResults: 'false'
150146

151147
- template: jobs/test.yaml
152148
parameters:
153-
name: macOS_10_15
154-
displayName: 'PowerShell 7.2 - macOS-10.15'
155-
imageName: 'macOS-10.15'
149+
name: macOS_11
150+
displayName: 'PowerShell 7.2 - macOS-11'
151+
imageName: 'macOS-11'
156152

157153
- template: jobs/test.yaml
158154
parameters:
159-
name: ps_5_1_windows_2019
160-
displayName: 'PowerShell 5.1 - Windows 2019'
161-
imageName: 'windows-2019'
155+
name: ps_5_1_windows_2022
156+
displayName: 'PowerShell 5.1 - Windows 2022'
157+
imageName: 'windows-2022'
162158
pwsh: 'false'
163159

164160
- template: jobs/test.yaml
165161
parameters:
166-
name: ps_7_2_windows_2019
167-
displayName: 'PowerShell 7.2 - Windows 2019'
168-
imageName: 'windows-2019'
162+
name: ps_7_2_windows_2022
163+
displayName: 'PowerShell 7.2 - Windows 2022'
164+
imageName: 'windows-2022'
165+
166+
# - template: jobs/testContainer.yaml
167+
# parameters:
168+
# name: alpine_3_14
169+
# displayName: 'PowerShell 7.2 - alpine-3.14'
170+
# imageName: mcr.microsoft.com/powershell/test-deps
171+
# imageTag: alpine-3.14
169172

170173
- template: jobs/testContainer.yaml
171174
parameters:
172-
name: alpine_3_14
173-
displayName: 'PowerShell 7.2 - alpine-3.14'
174-
imageName: mcr.microsoft.com/powershell/test-deps
175-
imageTag: alpine-3.14
175+
name: ps_7_2_ubuntu_22_04
176+
displayName: 'PowerShell 7.2 - ubuntu-22.04'
177+
imageName: mcr.microsoft.com/powershell
178+
imageTag: 7.2-ubuntu-22.04
176179

177180
- template: jobs/testContainer.yaml
178181
parameters:
179-
name: ps_7_2_ubuntu_20_04
180-
displayName: 'PowerShell 7.2 - ubuntu-20.04'
182+
name: ps_7_3_ubuntu_22_04
183+
displayName: 'PowerShell 7.3 - ubuntu-22.04'
181184
imageName: mcr.microsoft.com/powershell
182-
imageTag: 7.2.2-ubuntu-20.04
183-
184-
# Release pipeline
185-
# - stage: Release
186-
# displayName: Release
187-
# dependsOn: [ 'Test', 'Analysis' ]
188-
# condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v1.'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v2.')))
189-
# jobs:
190-
# - job:
191-
# displayName: Live
192-
# pool:
193-
# vmImage: $(imageName)
194-
# variables:
195-
# isPreRelease: $[contains(variables['Build.SourceBranchName'], '-B')]
196-
# steps:
197-
198-
# # Download module from build
199-
# - task: DownloadPipelineArtifact@2
200-
# displayName: 'Download module'
201-
# inputs:
202-
# artifact: PSRule
203-
# path: $(Build.SourcesDirectory)/out/modules/PSRule
204-
205-
# # Install pipeline dependencies
206-
# - powershell: ./.azure-pipelines/pipeline-deps.ps1
207-
# displayName: 'Install dependencies'
208-
209-
# # Install pipeline dependencies and build module
210-
# - powershell: Invoke-Build Release -ApiKey $(apiKey)
211-
# displayName: 'Publish module'
212-
213-
# # Update GitHub release
214-
# - task: GitHubRelease@1
215-
# displayName: 'GitHub release'
216-
# inputs:
217-
# gitHubConnection: 'AzureDevOps-PSRule'
218-
# repositoryName: '$(Build.Repository.Name)'
219-
# action: edit
220-
# tag: '$(Build.SourceBranchName)'
221-
# releaseNotesSource: inline
222-
# releaseNotesInline: 'See [change log](https://github.com/Microsoft/PSRule/blob/main/CHANGELOG.md)'
223-
# assetUploadMode: replace
224-
# addChangeLog: false
225-
# isPreRelease: $(isPreRelease)
185+
imageTag: 7.3-ubuntu-22.04

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Visual Studio Code image with .NET
5+
6+
# NOTE:
7+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/dotnet/.devcontainer/base.Dockerfile
8+
9+
ARG VARIANT="6.0-bullseye-slim"
10+
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}

.devcontainer/container-build.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# This is run during container creation.
66

77
# Install Python 3 dependencies
8+
sudo apt install python3-pip -y
89
sudo python3 -m pip install --upgrade pip
910
sudo python3 -m pip install wheel
1011

@@ -19,3 +20,6 @@ if ($Null -eq (Get-InstalledModule -Name PowerShellGet -MinimumVersion 2.2.1 -Er
1920
if ($Null -eq (Get-InstalledModule -Name InvokeBuild -MinimumVersion 5.4.0 -ErrorAction Ignore)) {
2021
Install-Module InvokeBuild -MinimumVersion 5.4.0 -Scope CurrentUser -Force;
2122
}
23+
24+
Import-Module ./scripts/dependencies.psm1;
25+
Install-Dependencies -Dev;

.devcontainer/container-start.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# This is run during container startup.
66

77
# Install Python packages
8-
# pip install -r requirements-docs.txt
8+
pip install -r requirements-docs.txt
99

1010
# Restore .NET packages
1111
dotnet restore

.devcontainer/devcontainer.json

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
{
2-
"name": "PSRule dev",
3-
"settings": {
2+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
3+
"name": "PSRule dev",
4+
"customizations": {
5+
"vscode": {
6+
"settings": {
47
"terminal.integrated.defaultProfile.linux": "pwsh",
58
"terminal.integrated.profiles.linux": {
6-
"pwsh": {
7-
"path": "/bin/pwsh"
8-
}
9+
"pwsh": {
10+
"path": "/opt/microsoft/powershell/7/pwsh"
11+
}
912
}
10-
},
11-
"extensions": [
12-
"ms-azure-devops.azure-pipelines",
13-
"davidanson.vscode-markdownlint",
14-
"bewhite.psrule-vscode-preview",
13+
},
14+
"extensions": [
1515
"ms-dotnettools.csharp",
16-
"eamodio.gitlens",
17-
"github.vscode-pull-request-github",
18-
"streetsidesoftware.code-spell-checker"
19-
],
20-
"features": {
21-
"github-cli": "latest"
22-
},
23-
"onCreateCommand": "/bin/pwsh -f .devcontainer/container-build.ps1",
24-
"postStartCommand": "/bin/pwsh -f .devcontainer/container-start.ps1"
16+
"bewhite.psrule-vscode-preview"
17+
]
18+
}
19+
},
20+
"features": {
21+
"github-cli": "latest",
22+
"powershell": "latest"
23+
},
24+
"onCreateCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
25+
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1",
26+
"build": {
27+
"dockerfile": "Dockerfile",
28+
"args": {
29+
"VARIANT": "6.0-bullseye-slim"
30+
}
31+
},
32+
"remoteUser": "vscode"
2533
}

.editorconfig

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ root = true
77
[*]
88
charset = utf-8
99
indent_style = space
10+
insert_final_newline = true
1011

1112
# Source code
1213
[*.{cs,ps1,psd1,psm1}]
@@ -44,4 +45,27 @@ csharp_prefer_simple_default_expression = true:suggestion
4445
# Prefer "var" everywhere
4546
csharp_style_var_for_built_in_types = true:suggestion
4647
csharp_style_var_when_type_is_apparent = true:suggestion
47-
csharp_style_var_elsewhere = true:suggestion
48+
csharp_style_var_elsewhere = true:suggestion
49+
50+
# Define the 'private_fields' symbol group:
51+
dotnet_naming_symbols.private_fields.applicable_kinds = field
52+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
53+
54+
# Define the 'private_static_fields' symbol group
55+
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
56+
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
57+
dotnet_naming_symbols.private_static_fields.required_modifiers = static
58+
59+
# Define the 'underscored' naming style
60+
dotnet_naming_style.underscored.capitalization = pascal_case
61+
dotnet_naming_style.underscored.required_prefix = _
62+
63+
# Private instance fields must use pascal case with a leading '_'
64+
dotnet_naming_rule.private_fields_underscored.symbols = private_fields
65+
dotnet_naming_rule.private_fields_underscored.style = underscored
66+
dotnet_naming_rule.private_fields_underscored.severity = error
67+
68+
# Exclude private static fields from underscored style
69+
dotnet_naming_rule.private_static_fields_none.symbols = private_static_fields
70+
dotnet_naming_rule.private_static_fields_none.style = underscored
71+
dotnet_naming_rule.private_static_fields_none.severity = none

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Steps to reproduce the issue:
3030
**Module in use and version:**
3131

3232
- Module: PSRule
33-
- Version: **[e.g. 2.0.0]**
33+
- Version: **[e.g. 2.4.0]**
3434

3535
Captured output from `$PSVersionTable`:
3636

.github/workflows/analyze.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
- cron: '24 22 * * 0' # At 10:24 PM, on Sunday each week
2020
workflow_dispatch:
2121

22+
permissions: {}
23+
2224
jobs:
2325
oss:
2426
name: Analyze with PSRule

.github/workflows/dependencies.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
env:
1515
WORKING_BRANCH: dependencies/powershell-bump
1616

17+
permissions: {}
18+
1719
jobs:
1820
dependencies:
1921
name: Bump dependencies

.github/workflows/docs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
- main
1313
workflow_dispatch:
1414

15+
permissions: {}
16+
1517
jobs:
1618
deploy:
1719
name: Publish docs

0 commit comments

Comments
 (0)