-
Notifications
You must be signed in to change notification settings - Fork 101
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
Adding prettier command and running it for the first time #7893
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
{ | ||
"name": "Radius - Contributor", | ||
// For details see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
//Git and GitHub Setup | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
//Programming languages | ||
"ghcr.io/devcontainers/features/go:1": {}, | ||
"ghcr.io/guiyomh/features/gotestsum:0.1.1": {}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/typescript:2": {}, | ||
"ghcr.io/devcontainers/features/python:1": {}, | ||
//Container and K8s | ||
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { | ||
"minikube": "none" | ||
}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
"version": "latest", | ||
"moby": true | ||
}, | ||
//Tools | ||
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {}, | ||
"ghcr.io/mpriscella/features/kind:1": {}, | ||
"ghcr.io/dhoeric/features/stern:1": {}, | ||
//Dapr | ||
"ghcr.io/dapr/cli/dapr-cli:0": {} | ||
"name": "Radius - Contributor", | ||
// For details see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
//Git and GitHub Setup | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
//Programming languages | ||
"ghcr.io/devcontainers/features/go:1": {}, | ||
"ghcr.io/guiyomh/features/gotestsum:0.1.1": {}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/typescript:2": {}, | ||
"ghcr.io/devcontainers/features/python:1": {}, | ||
//Container and K8s | ||
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { | ||
"minikube": "none" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"redhat.vscode-yaml", | ||
"golang.go", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"ms-azuretools.vscode-bicep", | ||
"ms-kubernetes-tools.vscode-kubernetes-tools", | ||
"ms-azuretools.vscode-dapr", | ||
"ms-vscode.makefile-tools" | ||
] | ||
} | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
"version": "latest", | ||
"moby": true | ||
}, | ||
// Prerequisite for Code Generation, see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites#code-generation | ||
// Adding workspace as safe directory to avoid permission issues | ||
"postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/[email protected] && go install go.uber.org/mock/[email protected]", | ||
"hostRequirements": { | ||
"memory": "8gb" | ||
}, | ||
} | ||
//Tools | ||
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {}, | ||
"ghcr.io/mpriscella/features/kind:1": {}, | ||
"ghcr.io/dhoeric/features/stern:1": {}, | ||
//Dapr | ||
"ghcr.io/dapr/cli/dapr-cli:0": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"redhat.vscode-yaml", | ||
"golang.go", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"ms-azuretools.vscode-bicep", | ||
"ms-kubernetes-tools.vscode-kubernetes-tools", | ||
"ms-azuretools.vscode-dapr", | ||
"ms-vscode.makefile-tools" | ||
] | ||
} | ||
}, | ||
// Prerequisite for Code Generation, see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites#code-generation | ||
// Adding workspace as safe directory to avoid permission issues | ||
"postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/[email protected] && go install go.uber.org/mock/[email protected]", | ||
"hostRequirements": { | ||
"memory": "8gb" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# .prettierignore | ||
pkg/validator/testdata/put-environments-invalid-json.json | ||
|
||
hack/bicep-types-radius/generated/* | ||
|
||
bicep-types/* | ||
|
||
swagger/* | ||
ytimocin marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ------------------------------------------------------------ | ||
# Copyright 2023 The Radius Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ------------------------------------------------------------ | ||
|
||
.PHONY: prettier-check prettier-format me prettier | ||
|
||
PRETTIER_VERSION := 3.3.3 | ||
|
||
format-check: | ||
@echo "$(ARROW) Checking for formatting issues using prettier..." | ||
@echo "" | ||
@npx prettier@$(PRETTIER_VERSION) --check "*/**/*.{ts,js,mjs,json}" | ||
|
||
format-write: | ||
@echo "$(ARROW) Reformatting files using prettier..." | ||
@echo "" | ||
@npx prettier@$(PRETTIER_VERSION) --write "*/**/*.{ts,js,mjs,json}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the experience like if node is not installed? What about when it's an ancient version of node? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
{ | ||
"name": "Radius CLI", | ||
"id": "radcli", | ||
"version": "0.1.0", | ||
"dependsOn": { | ||
"ghcr.io/dhoeric/features/oras:1": {} | ||
}, | ||
"description": "Installs the Radius CLI along with needed dependencies.", | ||
"documentationURL": "https://docs.radapp.io/installation/", | ||
"options": { | ||
"version": { | ||
"type": "string", | ||
"proposals": [ | ||
"latest", | ||
"edge" | ||
], | ||
"default": "latest", | ||
"description": "Select or enter an Radius CLI version. Use 'latest' for the latest stable version, 'edge' for the latest development version, or a specific version number (e.g. 0.28.0)." | ||
} | ||
"name": "Radius CLI", | ||
"id": "radcli", | ||
"version": "0.1.0", | ||
"dependsOn": { | ||
"ghcr.io/dhoeric/features/oras:1": {} | ||
}, | ||
"description": "Installs the Radius CLI along with needed dependencies.", | ||
"documentationURL": "https://docs.radapp.io/installation/", | ||
"options": { | ||
"version": { | ||
"type": "string", | ||
"proposals": ["latest", "edge"], | ||
"default": "latest", | ||
"description": "Select or enter an Radius CLI version. Use 'latest' for the latest stable version, 'edge' for the latest development version, or a specific version number (e.g. 0.28.0)." | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ | ||
"edge": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"radcli": { | ||
"version": "edge" | ||
} | ||
} | ||
}, | ||
"version": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"radcli": { | ||
"version": "0.27.0" | ||
} | ||
} | ||
"edge": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"radcli": { | ||
"version": "edge" | ||
} | ||
} | ||
} | ||
}, | ||
"version": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"radcli": { | ||
"version": "0.27.0" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,13 @@ You can build the repository with `make build`. This will build all of the packa | |
The following command will build, run unit tests, and run linters. This command is handy for verifying that your local changes are working correctly. | ||
|
||
```sh | ||
make build test lint | ||
make build test lint format-check | ||
``` | ||
|
||
You should also run `make format-write` if you have errors in the `format-check` command that you ran above or have added new or changed existing TS, JS, MJS, and/or JSON files. | ||
|
||
```sh | ||
make format-write | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we be less clever about the name? I think this guidance should be combined with line 14. The idea is that we're giving contributors simple advice. Saying "run |
||
|
||
- See further information about tests [here](../contributing-code-tests/). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍