Skip to content

Commit

Permalink
Add prettier to lint JavaScript code (dapr#5948)
Browse files Browse the repository at this point in the history
* Add prettier to lint JavaScript code

Signed-off-by: ItalyPaleAle <[email protected]>

* Updated CONTRIBUTING
Added "make me prettier"

Signed-off-by: ItalyPaleAle <[email protected]>

---------

Signed-off-by: ItalyPaleAle <[email protected]>
Co-authored-by: Mukundan Sundararajan <[email protected]>
Co-authored-by: Yaron Schneider <[email protected]>
Co-authored-by: Loong Dai <[email protected]>
Co-authored-by: Artur Souza <[email protected]>
  • Loading branch information
5 people authored Mar 8, 2023
1 parent 77136eb commit c4c4471
Show file tree
Hide file tree
Showing 16 changed files with 995 additions and 903 deletions.
140 changes: 70 additions & 70 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
{
"name": "Dapr Dev Environment",
// Update the container version when you publish dev-container
"image": "ghcr.io/dapr/dapr-dev:latest",
// Replace with uncommented line below to build your own local copy of the image
//"dockerFile": "../docker/Dockerfile-dev",
"containerEnv": {
// Uncomment to overwrite devcontainer .kube/config and .minikube certs with the localhost versions
// each time the devcontainer starts, if the respective .kube-localhost/config and .minikube-localhost
// folders respectively are bind mounted to the devcontainer.
// "SYNC_LOCALHOST_KUBECONFIG": "true",
"name": "Dapr Dev Environment",
// Update the container version when you publish dev-container
"image": "ghcr.io/dapr/dapr-dev:latest",
// Replace with uncommented line below to build your own local copy of the image
//"dockerFile": "../docker/Dockerfile-dev",
"containerEnv": {
// Uncomment to overwrite devcontainer .kube/config and .minikube certs with the localhost versions
// each time the devcontainer starts, if the respective .kube-localhost/config and .minikube-localhost
// folders respectively are bind mounted to the devcontainer.
// "SYNC_LOCALHOST_KUBECONFIG": "true",

// Uncomment to disable docker-in-docker and automatically proxy default /var/run/docker.sock to
// the localhost bind-mount /var/run/docker-host.sock.
// "BIND_LOCALHOST_DOCKER": "true",
// Uncomment to disable docker-in-docker and automatically proxy default /var/run/docker.sock to
// the localhost bind-mount /var/run/docker-host.sock.
// "BIND_LOCALHOST_DOCKER": "true",

// Necessary for components-contrib's certification tests
"GOLANG_PROTOBUF_REGISTRATION_CONFLICT": "true"
},
"extensions": [
"davidanson.vscode-markdownlint",
"golang.go",
"ms-azuretools.vscode-dapr",
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools"
],
"features": {
"ghcr.io/devcontainers/features/sshd:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/azure-cli:1": {}
},
"mounts": [
// Mount docker-in-docker library volume
"type=volume,source=dind-var-lib-docker,target=/var/lib/docker",
// Necessary for components-contrib's certification tests
"GOLANG_PROTOBUF_REGISTRATION_CONFLICT": "true"
},
"extensions": [
"davidanson.vscode-markdownlint",
"golang.go",
"ms-azuretools.vscode-dapr",
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools"
],
"features": {
"ghcr.io/devcontainers/features/sshd:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/azure-cli:1": {}
},
"mounts": [
// Mount docker-in-docker library volume
"type=volume,source=dind-var-lib-docker,target=/var/lib/docker",

// Bind mount docker socket under an alias to support docker-from-docker
"type=bind,source=/var/run/docker.sock,target=/var/run/docker-host.sock"
// Bind mount docker socket under an alias to support docker-from-docker
"type=bind,source=/var/run/docker.sock,target=/var/run/docker-host.sock"

// Uncomment to clone local .kube/config into devcontainer
// "type=bind,source=${env:HOME}${env:USERPROFILE}/.kube,target=/home/dapr/.kube-localhost",
// Uncomment to clone local .kube/config into devcontainer
// "type=bind,source=${env:HOME}${env:USERPROFILE}/.kube,target=/home/dapr/.kube-localhost",

// Uncomment to additionally clone minikube certs into devcontainer for use with .kube/config
// "type=bind,source=${env:HOME}${env:USERPROFILE}/.minikube,target=/home/dapr/.minikube-localhost"
],
// Always run image-defined default command
"overrideCommand": false,
// On Linux, this will prevent new files getting created as root, but you
// may need to update the USER_UID and USER_GID in docker/Dockerfile-dev
// to match your user if not 1000.
"remoteUser": "dapr",
"runArgs": [
// Enable ptrace-based debugging for go
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
// Uncomment to additionally clone minikube certs into devcontainer for use with .kube/config
// "type=bind,source=${env:HOME}${env:USERPROFILE}/.minikube,target=/home/dapr/.minikube-localhost"
],
// Always run image-defined default command
"overrideCommand": false,
// On Linux, this will prevent new files getting created as root, but you
// may need to update the USER_UID and USER_GID in docker/Dockerfile-dev
// to match your user if not 1000.
"remoteUser": "dapr",
"runArgs": [
// Enable ptrace-based debugging for go
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",

// Uncomment to bind to host network for local devcontainer; this is necessary if using the
// bind-mounted /var/run/docker-host.sock directly.
// "--net=host",
// Uncomment to bind to host network for local devcontainer; this is necessary if using the
// bind-mounted /var/run/docker-host.sock directly.
// "--net=host",

// Enable docker-in-docker configuration. Comment out if not using for better security.
"--privileged",
// Enable docker-in-docker configuration. Comment out if not using for better security.
"--privileged",

// Run the entrypoint defined in container image.
"--init"
],
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.buildTags": "e2e,perf,conftests,unit,integration_test,certtests",
"git.alwaysSignOff": true,
"terminal.integrated.env.linux": {
"GOLANG_PROTOBUF_REGISTRATION_CONFLICT": "ignore"
}
},
"workspaceFolder": "/workspaces/dapr",
"workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/workspaces/dapr"
}
// Run the entrypoint defined in container image.
"--init"
],
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.buildTags": "e2e,perf,conftests,unit,integration_test,certtests",
"git.alwaysSignOff": true,
"terminal.integrated.env.linux": {
"GOLANG_PROTOBUF_REGISTRATION_CONFLICT": "ignore"
}
},
"workspaceFolder": "/workspaces/dapr",
"workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/workspaces/dapr"
}
8 changes: 5 additions & 3 deletions .github/scripts/check_go_mod.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

import {readFile} from 'node:fs/promises'
import { readFile } from 'node:fs/promises'

const match = `// Uncomment for local development for testing with changes in the components-contrib repository.
// Don't commit with this uncommented!
Expand All @@ -10,9 +10,11 @@ const match = `// Uncomment for local development for testing with changes in th
// Then, run \`make modtidy\` in this repository.
// This ensures that go.mod and go.sum are up-to-date.`

const read = await readFile('go.mod', {encoding: 'utf8'})
const read = await readFile('go.mod', { encoding: 'utf8' })
if (!read.includes(match)) {
console.log('File go.mod was committed with a change in the block around "replace github.com/dapr/components-contrib"')
console.log(
'File go.mod was committed with a change in the block around "replace github.com/dapr/components-contrib"'
)
process.exit(1)
}
console.log('go.mod is ok')
Loading

0 comments on commit c4c4471

Please sign in to comment.