Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings and extensions #3

Merged
merged 3 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Visual Studio Code image with .NET

# NOTE:
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/dotnet/.devcontainer/base.Dockerfile

ARG VARIANT="6.0-bullseye-slim"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
5 changes: 5 additions & 0 deletions .devcontainer/container-build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Note:
# This is run during container creation.
5 changes: 5 additions & 0 deletions .devcontainer/container-start.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Note:
# This is run during container startup.
125 changes: 72 additions & 53 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,78 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest",
"modules": "Az,PSRule.Rules.Azure"
},
"azure-cli": {
"version": "latest"
},
"ghcr.io/devcontainers/features/azure-cli:1": {
"installBicep": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/dotnet:1": {
"runtimeOnly": true,
"version": "6"
}
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
"name": "PSRule Demo on Ubuntu Container",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "latest"
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.powershell",
"ms-azuretools.vscode-azureresourcegroups",
"ms-azuretools.vscode-bicep",
"editorconfig.editorconfig",
"bewhite.psrule-vscode-preview",
"shuworks.vscode-table-formatter",
"streetsidesoftware.code-spell-checker",
"wmaurer.change-case",
"esbenp.prettier-vscode",
"davidanson.vscode-markdownlint",
"vsls-contrib.codetour"
]
}

"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest",
"modules": "Az,PSRule.Rules.Azure"
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "vscode"
"azure-cli": {
"version": "latest"
},
"ghcr.io/devcontainers/features/azure-cli:1": {
"installBicep": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/dotnet:1": {
"runtimeOnly": true,
"version": "6"
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"ms-vscode.powershell",
"bewhite.psrule-vscode-preview",
"msazurermtools.azurerm-vscode-tools",
"ms-azuretools.vscode-bicep",
"ms-azure-devops.azure-pipelines",
"shuworks.vscode-table-formatter",
"streetsidesoftware.code-spell-checker",
"wmaurer.change-case",
"esbenp.prettier-vscode",
"davidanson.vscode-markdownlint",
"vsls-contrib.codetour",
"ms-azuretools.vscode-azureresourcegroups",
"editorconfig.editorconfig"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "pwsh",
"terminal.integrated.profiles.linux": {
"pwsh": {
"path": "/opt/microsoft/powershell/7/pwsh"
}
},
"PSRule.notifications.showPowerShellExtension": false,
"PSRule.notifications.showChannelUpgrade": false
}
}
},
"onCreateCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "6.0-bullseye-slim"
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "vscode"
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ packages/
Tools/NuGet/
updatablehelp/
xhtml/
**/settings.json
StaleContentReport.*.csv
.vscode/styles
.vale/
8 changes: 7 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-azuretools.vscode-docker",
"ms-vscode.powershell",
"bewhite.psrule-vscode-preview",
"msazurermtools.azurerm-vscode-tools",
"ms-azuretools.vscode-bicep",
"ms-azure-devops.azure-pipelines",
"shuworks.vscode-table-formatter",
"streetsidesoftware.code-spell-checker",
"wmaurer.change-case",
"esbenp.prettier-vscode",
"davidanson.vscode-markdownlint",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"ms-azuretools.vscode-azureresourcegroups",
"editorconfig.editorconfig"
]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"workbench.colorTheme": "GitHub Dark",
"redhat.telemetry.enabled": true,
"powershell.integratedConsole.showOnStartup": false,
"powershell.integratedConsole.focusConsoleOnExecute": false,
"files.associations": {
"**/.pipelines/**/*.yaml": "azure-pipelines"
},
"yaml.format.singleQuote": true,
"files.insertFinalNewline": true,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"[powershell]": {
"editor.formatOnSave": false,
"editor.tabSize": 4
},
}
5 changes: 0 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
"kind": "build",
"isDefault": true
},
"inputPath": "examples/",
"outcome": [
"Fail",
"Error",
]
}
]
}
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "0.2"
ignorePaths:
- .vscode/
- devcontainer.json
- '**/settings.json'
- cspell.config.yaml
dictionaryDefinitions: []
words:
Expand Down
43 changes: 39 additions & 4 deletions ps-rule.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,48 @@
## YAML: Enable expansion for Bicep source files.
#
# PSRule for Azure configuration
#

# Please see the documentation for all configuration options:
# https://aka.ms/ps-rule/options
# https://aka.ms/ps-rule-azure/options

# Configure binding for local rules.
binding:
preferTargetInfo: true
targetType:
- type
- resourceType

requires:
PSRule: '@pre >=2.9.0'
PSRule.Rules.Azure: '@pre >=1.27.3'

configuration:
# Enable automatic expansion of JSON parameter files.
AZURE_PARAMETER_FILE_EXPANSION: true

# Enable automatic expansion of Azure Bicep source files.
AZURE_BICEP_FILE_EXPANSION: true

# Configures the number of seconds to wait for build Bicep files.
AZURE_BICEP_FILE_EXPANSION_TIMEOUT: 10

# Enable automatic expansion of Bicep parameter files.
AZURE_BICEP_PARAMS_FILE_EXPANSION: true

# Enable Bicep CLI checks.
AZURE_BICEP_CHECK_TOOL: true

# Configure the minimum version of the Bicep CLI.
AZURE_BICEP_MINIMUM_VERSION: '0.18.4'

input:
pathIgnore:
# Ignore other files in the repository.
- '.vscode/'
- '.github/'
- '*.md'

# Exclude bicepconfig.json
- 'bicepconfig.json'

Expand All @@ -16,9 +54,6 @@ include:
module:
- PSRule.Rules.Azure

requires:
PSRule.Rules.Azure: 'v1.27.3'

execution:
aliasReference: Warn
duplicateResourceId: Error
Expand Down
10 changes: 0 additions & 10 deletions psrule.code-workspace

This file was deleted.