Skip to content

Commit

Permalink
Updates to devcontainer configuration (#8823)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton authored Mar 29, 2023
1 parent 84c2565 commit d7509c6
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 106 deletions.
7 changes: 5 additions & 2 deletions .devcontainer/dockerfile → .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ RUN echo "export HISTFILE=/commandhistory/.bash_history" >> "/root/.bashrc" \
&& touch /commandhistory/.bash_history \
&& mkdir /workspace

SHELL ["/opt/microsoft/powershell/7/pwsh", "-c"]
RUN Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

# Install Pester, has to be 4.4.3 because 4.4.2 has bug in Unix machines
SHELL ["/usr/bin/pwsh", "-c"]
SHELL ["/opt/microsoft/powershell/7/pwsh", "-c"]
RUN $ErrorActionPreference='Stop'; Install-Module -Name Pester -Force -SkipPublisherCheck -MaximumVersion 4.4.3;

# Install PSScriptAnalyzer
SHELL ["/usr/bin/pwsh", "-c"]
SHELL ["/opt/microsoft/powershell/7/pwsh", "-c"]
RUN $ErrorActionPreference='Stop'; Install-Module -Name PSScriptAnalyzer -Force -SkipPublisherCheck -MaximumVersion 1.18.2;

# Git command prompt
Expand Down
59 changes: 34 additions & 25 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
{
"name": "dbatools",
"workspaceFolder": "/workspace",
"dockerComposeFile": [
"docker-compose.yml"
],
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
"MY_SERVERS": "dbatools1,dbatools2,dbatools3",
"MY_SERVER": "dbatools1"
},
"service": "dbatools1",
"settings": {
"terminal.integrated.shell.linux": "/usr/bin/pwsh"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"name": "dbatools",
"workspaceFolder": "/workspace",
"dockerComposeFile": ["docker-compose.yml"],
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
"MY_SERVERS": "dbatools1,dbatools2,dbatools3",
"MY_SERVER": "dbatools1"
},
"service": "dbatools1",
// Add the IDs of extensions you want installed when the container is created.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.powershell",
"ms-mssql.mssql",
"github.vscode-pull-request-github",
"2gua.rainbow-brackets",
"usernamehw.errorlens",
"oderwat.indent-rainbow",
"mhutchie.git-graph",
"usernamehw.errorlens"
]
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",
// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",
}
"wengerk.highlight-bad-chars",
"streetsidesoftware.code-spell-checker"
],
"settings": {
"terminal.integrated.profiles.linux": {
"pwsh": {
"path": "/opt/microsoft/powershell/7/pwsh",
"icon": "terminal-powershell"
}
},
"terminal.integrated.defaultProfile.linux": "pwsh"
}
}
}
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",
// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",
}
175 changes: 96 additions & 79 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,104 @@
// Place your settings in this file to overwrite default and user settings.
{
// cleans up whitespace
"files.trimTrailingWhitespace": true,
// formatting style this project adheres to: https://en.wikipedia.org/wiki/Indentation_style#Variant:_1TBS_(OTBS)
"powershell.codeFormatting.preset": "OTBS",
// editor settings for formatting standards on this project
// cleans up whitespace
"files.trimTrailingWhitespace": true,
// formatting style this project adheres to: https://en.wikipedia.org/wiki/Indentation_style#Variant:_1TBS_(OTBS)
"powershell.codeFormatting.preset": "OTBS",
// editor settings for formatting standards on this project
// editor settings that will auto add the closing quote or curly brace
"powershell.codeFormatting.useConstantStrings": false,
// now your double clicks on a variable names include the dollar sign '$'
// https://twitter.com/TylerLeonhardt/status/1102749805233737729
"[json]": {
"editor.tabSize": 2
},
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"diffEditor.ignoreTrimWhitespace": false,
"gitlens.codeLens.scopes": [
"document"
],
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
}
},
"[powershell]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?",
"editor.tabSize": 4,
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.formatOnSave": false,
// editor settings that will auto add the closing quote or curly brace
"editor.autoClosingBrackets": "always",
"editor.autoClosingQuotes": "always",
"editor.autoSurround": "languageDefined",
"powershell.codeFormatting.useConstantStrings": false,
// now your double clicks on a variable names include the dollar sign '$'
// https://twitter.com/TylerLeonhardt/status/1102749805233737729
"[powershell]": {
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?"
},
"powershell.scriptAnalysis.settingsPath": "bin\\PSScriptAnalyzerRules.psd1",
"powershell.codeFormatting.addWhitespaceAroundPipe": true,
"cSpell.words": [
"Aduck",
"Andreas",
"Bargsley",
"Benner",
"Bizzotto",
"Boggiano",
"Brodeur",
"CHECKDB",
"Ciucu",
"cjsommer",
"Cown",
"DBCC",
"dgmyrs",
"DISA",
"erinstellato",
"Fleitas",
"fleitasarts",
"Furgiuele",
"gbargsley",
"hiramfleitas",
"ifexists",
"ISNULL",
"Jakob",
"jaxnoth",
"jbruns",
"jpomfret",
"Kehayias",
"Kendal",
"Kirill",
"Klaas",
"Kokkinos",
"Kravtsov",
"Mikey",
"nchar",
"niphlod",
"ntext",
"nvarscar",
"Ordix",
"pittfurg",
"PKCS",
"Pollus",
"randomizer",
"richiebzzzt",
"Samuelsson",
"securables",
"serg",
"SMIME",
"Spid",
"Spids",
"SQLDB",
"sqlpadawan",
"sqlstad",
"SSDT",
"Stad",
"Stellato's",
"STIG",
"Tepp",
"Vandenberghe",
"Viorel",
"Wsfc",
"wsmelton"
]
}
"editor.autoSurround": "languageDefined"
},
"powershell.scriptAnalysis.settingsPath": "bin\\PSScriptAnalyzerRules.psd1",
"powershell.codeFormatting.addWhitespaceAroundPipe": true,
"cSpell.words": [
"Aduck",
"Andreas",
"Bargsley",
"Benner",
"Bizzotto",
"Boggiano",
"Brodeur",
"CHECKDB",
"Ciucu",
"cjsommer",
"Cown",
"DBCC",
"dgmyrs",
"DISA",
"erinstellato",
"Fleitas",
"fleitasarts",
"Furgiuele",
"gbargsley",
"hiramfleitas",
"ifexists",
"ISNULL",
"Jakob",
"jaxnoth",
"jbruns",
"jpomfret",
"Kehayias",
"Kendal",
"Kirill",
"Klaas",
"Kokkinos",
"Kravtsov",
"Mikey",
"nchar",
"niphlod",
"ntext",
"nvarscar",
"Ordix",
"pittfurg",
"PKCS",
"Pollus",
"randomizer",
"richiebzzzt",
"Samuelsson",
"securables",
"serg",
"SMIME",
"Spid",
"Spids",
"SQLDB",
"sqlpadawan",
"sqlstad",
"SSDT",
"Stad",
"Stellato's",
"STIG",
"Tepp",
"Vandenberghe",
"Viorel",
"Wsfc",
"wsmelton"
]
}

0 comments on commit d7509c6

Please sign in to comment.