Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/PSRule
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.0-B0267
Choose a base ref
...
head repository: microsoft/PSRule
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 490 changed files with 26,019 additions and 6,296 deletions.
15 changes: 5 additions & 10 deletions .devcontainer/container-build.ps1
Original file line number Diff line number Diff line change
@@ -4,18 +4,13 @@
# Note:
# This is run during container creation.

# Install Python 3 dependencies
sudo apt-get update
sudo apt-get install dotnet-sdk-8.0 -y
sudo apt-get install python3-pip -y
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install wheel
sudo apt-get update -y
sudo apt-get upgrade -y
dotnet restore

# Install Python packages
pip install -r requirements-docs.txt
# . /home/vscode/python/dev/bin/Activate.ps1

# Restore .NET packages
dotnet restore
pip install -r requirements-docs.txt

# Install PowerShell dependencies
$ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue;
16 changes: 6 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "PSRule development environment",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
"name": "PSRule Developer",
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-noble",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "pwsh",
"terminal.integrated.profiles.linux": {
"pwsh": {
"path": "/usr/local/bin/pwsh"
"path": "/usr/bin/pwsh"
}
}
},
@@ -31,14 +30,11 @@
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "latest"
}
},
"onCreateCommand": "sudo chown -R vscode:vscode /opt/microsoft/powershell/7/pwsh && sudo chmod u+x /opt/microsoft/powershell/7/pwsh && wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb && sudo apt-get update && sudo apt-get install dotnet-sdk-8.0 -y && sudo apt-get install python3-pip -y",
"updateContentCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1"
"onCreateCommand": "dotnet tool install --global PowerShell --version 7.4.6 && sudo chown -R vscode:vscode /usr/bin/pwsh && sudo apt-get update -y && sudo apt-get upgrade -y && dotnet restore && pip install -r requirements-docs.txt && ln /usr/bin/pwsh /home/vscode/.dotnet/tools/pwsh --force",
"updateContentCommand": "/usr/bin/pwsh -f .devcontainer/container-build.ps1",
"postStartCommand": "/usr/bin/pwsh -f .devcontainer/container-start.ps1"
}
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -23,9 +23,14 @@ 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

# Compiler warnings
dotnet_diagnostic.CS0472.severity = error
dotnet_diagnostic.CS0436.severity = error

# License header
file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
207 changes: 207 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
{
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint/tslint"
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "warn",
"@typescript-eslint/array-type": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/class-name-casing": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/explicit-member-accessibility": [
"warn",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/indent": [
"warn",
4,
{
"FunctionDeclaration": {
"parameters": "first"
},
"FunctionExpression": {
"parameters": "first"
}
}
],
"@typescript-eslint/interface-name-prefix": "warn",
"@typescript-eslint/member-delimiter-style": [
"warn",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-misused-new": "warn",
"@typescript-eslint/no-namespace": "warn",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-namespace-keyword": "warn",
"@typescript-eslint/quotes": [
"warn",
"double",
{
"avoidEscape": true
}
],
"@typescript-eslint/semi": [
"warn",
"always"
],
"@typescript-eslint/triple-slash-reference": "warn",
"@typescript-eslint/type-annotation-spacing": "warn",
"@typescript-eslint/unified-signatures": "warn",
"arrow-body-style": "warn",
"arrow-parens": [
"warn",
"as-needed"
],
"camelcase": "warn",
"comma-dangle": [
"warn",
"always-multiline"
],
"complexity": "off",
"constructor-super": "warn",
"curly": "warn",
"dot-notation": "warn",
"eol-last": "warn",
"eqeqeq": [
"warn",
"smart"
],
"guard-for-in": "warn",
"id-blacklist": [
"warn",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "warn",
"import/order": "warn",
"max-classes-per-file": "off",
"max-len": [
"warn",
{
"code": 120
}
],
"new-parens": "warn",
"no-bitwise": "warn",
"no-caller": "warn",
"no-cond-assign": "warn",
"no-console": "warn",
"no-debugger": "warn",
"no-empty": "warn",
"no-eval": "warn",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-multiple-empty-lines": "warn",
"no-new-wrappers": "warn",
"no-shadow": [
"warn",
{
"hoist": "all"
}
],
"no-throw-literal": "warn",
"no-trailing-spaces": "warn",
"no-undef-init": "warn",
"no-underscore-dangle": "warn",
"no-unsafe-finally": "warn",
"no-unused-expressions": "warn",
"no-unused-labels": "warn",
"no-var": "warn",
"object-shorthand": "warn",
"one-var": [
"warn",
"never"
],
"prefer-arrow/prefer-arrow-functions": "warn",
"prefer-const": "warn",
"quote-props": [
"warn",
"consistent-as-needed"
],
"radix": "warn",
"space-before-function-paren": [
"warn",
{
"anonymous": "never",
"asyncArrow": "always",
"named": "never"
}
],
"spaced-comment": "warn",
"use-isnan": "warn",
"valid-typeof": "off",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"file-header": [
true,
"Copyright \\(c\\) Microsoft Corporation."
],
"import-spacing": true,
"jsdoc-format": true,
"no-reference-import": true,
"one-line": [
true,
"check-catch",
"check-else",
"check-finally",
"check-open-brace",
"check-whitespace"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
}
}
]
}
}
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug report
description: Report errors or unexpected behavior
title: '[BUG] <title>'
type: Bug
labels: ['Needs: Triage :mag:']
body:
- type: textarea
id: issue
attributes:
label: Description of the issue
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: messages
attributes:
label: Error messages
description: If an error message is generated by the output please provide it here.
validations:
required: false
- type: textarea
attributes:
label: Reproduction
description: |
How can we reproduce the issue.
Please provide examples of the input or pipelines you are using that are failing.
For example, if expansion is failing please provide a Bicep example that demonstrates the issue so we can reproduce the issue.
validations:
required: true
- type: input
id: psrule
attributes:
label: Version of PSRule
description: Please provide the version of PSRule you are using.
placeholder: '2.9.0'
validations:
required: true
- type: input
id: tool
attributes:
label: How are you running PSRule
description: Please provide brief details on how you are running PSRule, for example, GitHub Actions, Azure DevOps, Visual Studio Code, or locally with PowerShell.
placeholder: vscode
- type: textarea
id: context
attributes:
label: Additional context
description: |
Any additional context relating to the issue.
If this issue is occurring in a public GitHub repository with a pipeline that demonstrates the issue please provide a link to it here.
validations:
required: false
43 changes: 0 additions & 43 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

Loading