Merge pull request #193 from JustinGrote/dev/vsCodeHelpers

Dev: Add Visual Studio Code + Github Codespaces Support
This commit is contained in:
Zack Koppert 2020-06-24 14:37:08 -07:00 committed by GitHub
commit 26d2ec1d2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 85 additions and 4 deletions

View file

@ -0,0 +1,37 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.123.0/containers/docker-existing-dockerfile
{
"name": "SUPER-LINTER",
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "..\\Dockerfile",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"github.vscode-pull-request-github",
"rogalmic.bash-debug"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line to run commands after the container is created - for example installing curl.
//"postCreateCommand": "ln -s /workspaces/super-linter/.automation/test /tmp/lint",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}

3
.gitattributes vendored Normal file
View file

@ -0,0 +1,3 @@
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf

19
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Test Linter",
"program": ".vscode/testlinter.sh",
"cwd": "${workspaceFolder}",
"internalConsoleOptions": "openOnSessionStart",
"presentation": {
"group": "aLinter"
}
}
]
}

11
.vscode/testlinter.sh vendored Normal file
View file

@ -0,0 +1,11 @@
#!/bin/bash
#At this point you can use the debug console to add export GITHUB_WORKSPACE=/path to test only a specific folder
#You can also use ln -s /path /tmp/lint as an alternative
#If you do neither, this will default to running against the test automation files
tmppath=/tmp/lint
if [ ! -L $tmppath ]; then
ln -s $PWD/.automation/test $tmppath
fi
export RUN_LOCAL=true
source $PWD/lib/linter.sh

View file

@ -185,6 +185,13 @@ Below are a list of the known limitations for the **GitHub Super-Linter**:
## How to contribute ## How to contribute
If you would like to help contribute to this **GitHub** Action, please see [CONTRIBUTING](https://github.com/github/super-linter/blob/master/.github/CONTRIBUTING.md) If you would like to help contribute to this **GitHub** Action, please see [CONTRIBUTING](https://github.com/github/super-linter/blob/master/.github/CONTRIBUTING.md)
### Visual Studio Code
You can checkout this repository using [Container Remote Development](https://code.visualstudio.com/docs/remote/containers), and debug the linter using the `Test Linter` task.
![Example](https://user-images.githubusercontent.com/15258962/85165778-2d2ce700-b21b-11ea-803e-3f6709d8e609.gif)
We will also support [Github Codespaces](https://github.com/features/codespaces/) once it becomes available
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
### License ### License

View file

@ -605,6 +605,14 @@ GetGitHubVars()
########################################## ##########################################
echo "NOTE: ENV VAR [RUN_LOCAL] has been set to:[true]" echo "NOTE: ENV VAR [RUN_LOCAL] has been set to:[true]"
echo "bypassing GitHub Actions variables..." echo "bypassing GitHub Actions variables..."
############################
# Set the GITHUB_WORKSPACE #
############################
if [ -z "$GITHUB_WORKSPACE" ]; then
GITHUB_WORKSPACE="$DEFAULT_WORKSPACE"
fi
echo "Linting all files in mapped directory:[$DEFAULT_WORKSPACE]" echo "Linting all files in mapped directory:[$DEFAULT_WORKSPACE]"
# No need to touch or set the GITHUB_SHA # No need to touch or set the GITHUB_SHA
@ -612,10 +620,6 @@ GetGitHubVars()
# No need to touch or set the GITHUB_ORG # No need to touch or set the GITHUB_ORG
# No need to touch or set the GITHUB_REPO # No need to touch or set the GITHUB_REPO
############################
# Set the GITHUB_WORKSPACE #
############################
GITHUB_WORKSPACE="$DEFAULT_WORKSPACE"
################################# #################################
# Set the VALIDATE_ALL_CODEBASE # # Set the VALIDATE_ALL_CODEBASE #