mirror of https://github.com/coder/coder.git
chore: Improve project-wide prettier formatting and ignored files (#5505)
* chore: Improve project-wide prettier formatting and ignored files * chore: `Run make fmt/prettier` * Fix gitignore for `.vscode` folder so that ! works * Add comment in `.prettierrc.yaml` to explain `.editorconfig` * Remove scripts/apidocgen/markdown-template/README.md * Use `yq` for processing prettierrc, update lib.sh dependency check * Add `yq` to Dockerfile and Nix
This commit is contained in:
parent
5435bceaf0
commit
856f0ab6f5
|
@ -67,6 +67,7 @@ RUN echo 'export PATH=$GOPATH/bin:$PATH' >> $HOME/.bashrc
|
||||||
RUN bash -c ". $HOME/.bashrc \
|
RUN bash -c ". $HOME/.bashrc \
|
||||||
go install -v golang.org/x/tools/gopls@latest \
|
go install -v golang.org/x/tools/gopls@latest \
|
||||||
&& go install -v mvdan.cc/sh/v3/cmd/shfmt@latest \
|
&& go install -v mvdan.cc/sh/v3/cmd/shfmt@latest \
|
||||||
|
&& go install -v github.com/mikefarah/yq/v4@v4.30.6 \
|
||||||
"
|
"
|
||||||
|
|
||||||
# install nodejs
|
# install nodejs
|
||||||
|
@ -80,4 +81,3 @@ RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/horta/zstd.install/m
|
||||||
RUN echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list \
|
RUN echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list \
|
||||||
&& apt update \
|
&& apt update \
|
||||||
&& apt install nfpm
|
&& apt install nfpm
|
||||||
|
|
||||||
|
|
|
@ -14,5 +14,11 @@
|
||||||
"postStartCommand": "dockerd",
|
"postStartCommand": "dockerd",
|
||||||
|
|
||||||
// privileged is required by GitHub codespaces - https://github.com/microsoft/vscode-dev-containers/issues/727
|
// privileged is required by GitHub codespaces - https://github.com/microsoft/vscode-dev-containers/issues/727
|
||||||
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--privileged", "--init" ]
|
"runArgs": [
|
||||||
|
"--cap-add=SYS_PTRACE",
|
||||||
|
"--security-opt",
|
||||||
|
"seccomp=unconfined",
|
||||||
|
"--privileged",
|
||||||
|
"--init"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
[*.{md,json,yaml,yml,tf,tfvars}]
|
[*.{md,json,yaml,yml,tf,tfvars,nix}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@ jobs:
|
||||||
# the below token should have repo scope and must be manually added by you in the repository's secret
|
# the below token should have repo scope and must be manually added by you in the repository's secret
|
||||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }}
|
PERSONAL_ACCESS_TOKEN: ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
remote-organization-name: 'coder'
|
remote-organization-name: "coder"
|
||||||
remote-repository-name: 'cla'
|
remote-repository-name: "cla"
|
||||||
path-to-signatures: 'v2022-09-04/signatures.json'
|
path-to-signatures: "v2022-09-04/signatures.json"
|
||||||
path-to-document: 'https://github.com/coder/cla/blob/main/README.md'
|
path-to-document: "https://github.com/coder/cla/blob/main/README.md"
|
||||||
# branch should not be protected
|
# branch should not be protected
|
||||||
branch: 'main'
|
branch: "main"
|
||||||
allowlist: dependabot*
|
allowlist: dependabot*
|
||||||
|
|
|
@ -222,6 +222,8 @@ jobs:
|
||||||
run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
|
run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
|
||||||
- name: Install goimports
|
- name: Install goimports
|
||||||
run: go install golang.org/x/tools/cmd/goimports@latest
|
run: go install golang.org/x/tools/cmd/goimports@latest
|
||||||
|
- name: Install yq
|
||||||
|
run: go run github.com/mikefarah/yq/v4@v4.30.6
|
||||||
|
|
||||||
- name: Install Protoc
|
- name: Install Protoc
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
{
|
{
|
||||||
"pattern": ":\/\/localhost"
|
"pattern": "://localhost"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": ":\/\/.*.?example\\.com"
|
"pattern": "://.*.?example\\.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "developer.github.com"
|
"pattern": "developer.github.com"
|
||||||
|
|
|
@ -176,7 +176,7 @@ jobs:
|
||||||
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
|
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
|
||||||
|
|
||||||
- name: Setup GCloud SDK
|
- name: Setup GCloud SDK
|
||||||
uses: 'google-github-actions/setup-gcloud@v1'
|
uses: "google-github-actions/setup-gcloud@v1"
|
||||||
|
|
||||||
- name: Publish Helm Chart
|
- name: Publish Helm Chart
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -15,8 +15,8 @@ jobs:
|
||||||
# https://github.com/actions/stale/pull/775
|
# https://github.com/actions/stale/pull/775
|
||||||
- uses: actions/stale@v6.0.0
|
- uses: actions/stale@v6.0.0
|
||||||
with:
|
with:
|
||||||
stale-issue-label: 'stale'
|
stale-issue-label: "stale"
|
||||||
stale-pr-label: 'stale'
|
stale-pr-label: "stale"
|
||||||
# Pull Requests become stale more quickly due to merge conflicts.
|
# Pull Requests become stale more quickly due to merge conflicts.
|
||||||
# Also, we promote minimizing WIP.
|
# Also, we promote minimizing WIP.
|
||||||
days-before-pr-stale: 7
|
days-before-pr-stale: 7
|
||||||
|
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
- uses: wow-actions/welcome@v1
|
- uses: wow-actions/welcome@v1
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
FIRST_PR_REACTIONS: '+1, hooray, rocket, heart'
|
FIRST_PR_REACTIONS: "+1, hooray, rocket, heart"
|
||||||
FIRST_PR_COMMENT: |
|
FIRST_PR_COMMENT: |
|
||||||
👋 Welcome @{{ author }} to Coder! Yo @coder/docs this is @{{ author }}'s first pull-request here!
|
👋 Welcome @{{ author }} to Coder! Yo @coder/docs this is @{{ author }}'s first pull-request here!
|
||||||
FIRST_PR_MERGED: |
|
FIRST_PR_MERGED: |
|
||||||
|
|
|
@ -1,40 +1,33 @@
|
||||||
###############################################################################
|
# Common ignore patterns, these rules applies in both root and subdirectories.
|
||||||
# NOTICE #
|
.DS_Store
|
||||||
# If you change this file, kindly copy-pasta your change into .prettierignore #
|
|
||||||
# and .eslintignore as well. See the following discussions to understand why #
|
|
||||||
# we have to resort to this duplication (at least for now): #
|
|
||||||
# #
|
|
||||||
# https://github.com/prettier/prettier/issues/8048 #
|
|
||||||
# https://github.com/prettier/prettier/issues/8506 #
|
|
||||||
# https://github.com/prettier/prettier/issues/8679 #
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
vendor
|
|
||||||
.eslintcache
|
.eslintcache
|
||||||
yarn-error.log
|
.gitpod.yml
|
||||||
|
.idea
|
||||||
|
**/*.swp
|
||||||
gotests.coverage
|
gotests.coverage
|
||||||
gotests.xml
|
gotests.xml
|
||||||
gotestsum.json
|
gotestsum.json
|
||||||
.idea
|
node_modules/
|
||||||
.gitpod.yml
|
vendor/
|
||||||
.DS_Store
|
yarn-error.log
|
||||||
|
|
||||||
|
# VSCode settings.
|
||||||
|
**/.vscode/*
|
||||||
|
# Allow VSCode recommendations and default settings in project root.
|
||||||
|
!/.vscode/extensions.json
|
||||||
|
!/.vscode/settings.json
|
||||||
|
|
||||||
|
# Front-end ignore patterns.
|
||||||
|
.next/
|
||||||
|
site/**/*.typegen.ts
|
||||||
|
site/build-storybook.log
|
||||||
|
site/coverage/
|
||||||
|
site/storybook-static/
|
||||||
|
site/test-results/
|
||||||
|
|
||||||
# Make target for updating golden files.
|
# Make target for updating golden files.
|
||||||
cli/testdata/.gen-golden
|
cli/testdata/.gen-golden
|
||||||
|
|
||||||
# Front-end ignore
|
|
||||||
.next/
|
|
||||||
site/.eslintcache
|
|
||||||
site/.next/
|
|
||||||
site/node_modules/
|
|
||||||
site/storybook-static/
|
|
||||||
site/test-results/
|
|
||||||
site/yarn-error.log
|
|
||||||
coverage/
|
|
||||||
site/**/*.typegen.ts
|
|
||||||
site/build-storybook.log
|
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
/build/
|
/build/
|
||||||
/dist/
|
/dist/
|
||||||
|
@ -46,10 +39,7 @@ site/out/
|
||||||
*.lock.hcl
|
*.lock.hcl
|
||||||
.terraform/
|
.terraform/
|
||||||
|
|
||||||
.vscode/*.log
|
/.coderv2/*
|
||||||
.vscode/launch.json
|
|
||||||
**/*.swp
|
|
||||||
.coderv2/*
|
|
||||||
**/__debug_bin
|
**/__debug_bin
|
||||||
|
|
||||||
# direnv
|
# direnv
|
||||||
|
|
|
@ -103,7 +103,7 @@ linters-settings:
|
||||||
settings:
|
settings:
|
||||||
ruleguard:
|
ruleguard:
|
||||||
failOn: all
|
failOn: all
|
||||||
rules: '${configDir}/scripts/rules.go'
|
rules: "${configDir}/scripts/rules.go"
|
||||||
|
|
||||||
staticcheck:
|
staticcheck:
|
||||||
# https://staticcheck.io/docs/options#checks
|
# https://staticcheck.io/docs/options#checks
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
# Code generated by Makefile (.gitignore .prettierignore.include). DO NOT EDIT.
|
||||||
|
|
||||||
|
# .gitignore:
|
||||||
|
# Common ignore patterns, these rules applies in both root and subdirectories.
|
||||||
|
.DS_Store
|
||||||
|
.eslintcache
|
||||||
|
.gitpod.yml
|
||||||
|
.idea
|
||||||
|
**/*.swp
|
||||||
|
gotests.coverage
|
||||||
|
gotests.xml
|
||||||
|
gotestsum.json
|
||||||
|
node_modules/
|
||||||
|
vendor/
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# VSCode settings.
|
||||||
|
**/.vscode/*
|
||||||
|
# Allow VSCode recommendations and default settings in project root.
|
||||||
|
!/.vscode/extensions.json
|
||||||
|
!/.vscode/settings.json
|
||||||
|
|
||||||
|
# Front-end ignore patterns.
|
||||||
|
.next/
|
||||||
|
site/**/*.typegen.ts
|
||||||
|
site/build-storybook.log
|
||||||
|
site/coverage/
|
||||||
|
site/storybook-static/
|
||||||
|
site/test-results/
|
||||||
|
|
||||||
|
# Make target for updating golden files.
|
||||||
|
cli/testdata/.gen-golden
|
||||||
|
|
||||||
|
# Build
|
||||||
|
/build/
|
||||||
|
/dist/
|
||||||
|
site/out/
|
||||||
|
|
||||||
|
*.tfstate
|
||||||
|
*.tfstate.backup
|
||||||
|
*.tfplan
|
||||||
|
*.lock.hcl
|
||||||
|
.terraform/
|
||||||
|
|
||||||
|
/.coderv2/*
|
||||||
|
**/__debug_bin
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.envrc
|
||||||
|
# .prettierignore.include:
|
||||||
|
# Helm templates contain variables that are invalid YAML and can't be formatted
|
||||||
|
# by Prettier.
|
||||||
|
helm/templates/*.yaml
|
||||||
|
|
||||||
|
# Terraform state files used in tests, these are automatically generated.
|
||||||
|
# Example: provisioner/terraform/testdata/instance-id/instance-id.tfstate.json
|
||||||
|
**/testdata/**/*.tf*.json
|
||||||
|
|
||||||
|
# Testdata shouldn't be formatted.
|
||||||
|
scripts/apitypings/testdata/**/*.ts
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Helm templates contain variables that are invalid YAML and can't be formatted
|
||||||
|
# by Prettier.
|
||||||
|
helm/templates/*.yaml
|
||||||
|
|
||||||
|
# Terraform state files used in tests, these are automatically generated.
|
||||||
|
# Example: provisioner/terraform/testdata/instance-id/instance-id.tfstate.json
|
||||||
|
**/testdata/**/*.tf*.json
|
||||||
|
|
||||||
|
# Testdata shouldn't be formatted.
|
||||||
|
scripts/apitypings/testdata/**/*.ts
|
|
@ -0,0 +1,16 @@
|
||||||
|
# This config file is used in conjunction with `.editorconfig` to specify
|
||||||
|
# formatting for prettier-supported files. See `.editorconfig` and
|
||||||
|
# `site/.editorconfig`for whitespace formatting options.
|
||||||
|
printWidth: 80
|
||||||
|
semi: false
|
||||||
|
trailingComma: all
|
||||||
|
overrides:
|
||||||
|
- files:
|
||||||
|
- README.md
|
||||||
|
options:
|
||||||
|
proseWrap: preserve
|
||||||
|
- files:
|
||||||
|
- "site/**/*.yaml"
|
||||||
|
- "site/**/*.yml"
|
||||||
|
options:
|
||||||
|
proseWrap: always
|
91
Makefile
91
Makefile
|
@ -369,9 +369,9 @@ fmt/prettier:
|
||||||
cd site
|
cd site
|
||||||
# Avoid writing files in CI to reduce file write activity
|
# Avoid writing files in CI to reduce file write activity
|
||||||
ifdef CI
|
ifdef CI
|
||||||
yarn run format:check . ../*.md ../docs
|
yarn run format:check
|
||||||
else
|
else
|
||||||
yarn run format:write . ../*.md ../docs
|
yarn run format:write
|
||||||
endif
|
endif
|
||||||
.PHONY: fmt/prettier
|
.PHONY: fmt/prettier
|
||||||
|
|
||||||
|
@ -411,13 +411,31 @@ gen: \
|
||||||
provisionerd/proto/provisionerd.pb.go \
|
provisionerd/proto/provisionerd.pb.go \
|
||||||
site/src/api/typesGenerated.ts \
|
site/src/api/typesGenerated.ts \
|
||||||
docs/admin/prometheus.md \
|
docs/admin/prometheus.md \
|
||||||
coderd/apidoc/swagger.json
|
coderd/apidoc/swagger.json \
|
||||||
|
.prettierignore.include \
|
||||||
|
.prettierignore \
|
||||||
|
site/.prettierrc.yaml \
|
||||||
|
site/.prettierignore \
|
||||||
|
site/.eslintignore
|
||||||
.PHONY: gen
|
.PHONY: gen
|
||||||
|
|
||||||
# Mark all generated files as fresh so make thinks they're up-to-date. This is
|
# Mark all generated files as fresh so make thinks they're up-to-date. This is
|
||||||
# used during releases so we don't run generation scripts.
|
# used during releases so we don't run generation scripts.
|
||||||
gen/mark-fresh:
|
gen/mark-fresh:
|
||||||
files="coderd/database/dump.sql coderd/database/querier.go provisionersdk/proto/provisioner.pb.go provisionerd/proto/provisionerd.pb.go site/src/api/typesGenerated.ts docs/admin/prometheus.md coderd/apidoc/swagger.json"
|
files="\
|
||||||
|
coderd/database/dump.sql \
|
||||||
|
coderd/database/querier.go \
|
||||||
|
provisionersdk/proto/provisioner.pb.go \
|
||||||
|
provisionerd/proto/provisionerd.pb.go \
|
||||||
|
site/src/api/typesGenerated.ts \
|
||||||
|
docs/admin/prometheus.md \
|
||||||
|
coderd/apidoc/swagger.json \
|
||||||
|
.prettierignore.include \
|
||||||
|
.prettierignore \
|
||||||
|
site/.prettierrc.yaml \
|
||||||
|
site/.prettierignore \
|
||||||
|
site/.eslintignore \
|
||||||
|
"
|
||||||
for file in $$files; do
|
for file in $$files; do
|
||||||
echo "$$file"
|
echo "$$file"
|
||||||
if [ ! -f "$$file" ]; then
|
if [ ! -f "$$file" ]; then
|
||||||
|
@ -463,21 +481,80 @@ site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./coders
|
||||||
docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
|
docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
|
||||||
go run scripts/metricsdocgen/main.go
|
go run scripts/metricsdocgen/main.go
|
||||||
cd site
|
cd site
|
||||||
yarn run format:write ../docs/admin/prometheus.md
|
yarn run format:write:only ../docs/admin/prometheus.md
|
||||||
|
|
||||||
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen -not \( -path './scripts/apidocgen/node_modules' -prune \) -type f) $(wildcard coderd/*.go) $(wildcard codersdk/*.go)
|
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen -not \( -path './scripts/apidocgen/node_modules' -prune \) -type f) $(wildcard coderd/*.go) $(wildcard codersdk/*.go)
|
||||||
./scripts/apidocgen/generate.sh
|
./scripts/apidocgen/generate.sh
|
||||||
cd site
|
cd site
|
||||||
yarn run format:write ../docs/api ../docs/manifest.json ../coderd/apidoc/swagger.json
|
yarn run format:write:only ../docs/api ../docs/manifest.json ../coderd/apidoc/swagger.json
|
||||||
|
|
||||||
update-golden-files: cli/testdata/.gen-golden
|
update-golden-files: cli/testdata/.gen-golden
|
||||||
.PHONY: update-golden-files
|
.PHONY: update-golden-files
|
||||||
|
|
||||||
cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) $(GO_SRC_FILES)
|
cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) $(GO_SRC_FILES)
|
||||||
|
|
||||||
go test ./cli -run=TestCommandHelp -update
|
go test ./cli -run=TestCommandHelp -update
|
||||||
touch "$@"
|
touch "$@"
|
||||||
|
|
||||||
|
# Generate a prettierrc for the site package that uses relative paths for
|
||||||
|
# overrides. This allows us to share the same prettier config between the
|
||||||
|
# site and the root of the repo.
|
||||||
|
site/.prettierrc.yaml: .prettierrc.yaml
|
||||||
|
. ./scripts/lib.sh
|
||||||
|
dependencies yq
|
||||||
|
|
||||||
|
echo "# Code generated by Makefile (../$<). DO NOT EDIT." > "$@"
|
||||||
|
echo "" >> "$@"
|
||||||
|
|
||||||
|
# Replace all listed override files with relative paths inside site/.
|
||||||
|
# - ./ -> ../
|
||||||
|
# - ./site -> ./
|
||||||
|
yq \
|
||||||
|
'.overrides[].files |= map(. | sub("^./"; "") | sub("^"; "../") | sub("../site/"; "./"))' \
|
||||||
|
"$<" >> "$@"
|
||||||
|
|
||||||
|
# Combine .gitignore with .prettierignore.include to generate .prettierignore.
|
||||||
|
.prettierignore: .gitignore .prettierignore.include
|
||||||
|
echo "# Code generated by Makefile ($^). DO NOT EDIT." > "$@"
|
||||||
|
echo "" >> "$@"
|
||||||
|
for f in $^; do
|
||||||
|
echo "# $${f}:" >> "$@"
|
||||||
|
cat "$$f" >> "$@"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Generate ignore files based on gitignore into the site directory. We turn all
|
||||||
|
# rules into relative paths for the `site/` directory (where applicable),
|
||||||
|
# following the pattern format defined by git:
|
||||||
|
# https://git-scm.com/docs/gitignore#_pattern_format
|
||||||
|
#
|
||||||
|
# This is done for compatibility reasons, see:
|
||||||
|
# https://github.com/prettier/prettier/issues/8048
|
||||||
|
# https://github.com/prettier/prettier/issues/8506
|
||||||
|
# https://github.com/prettier/prettier/issues/8679
|
||||||
|
site/.eslintignore site/.prettierignore: .prettierignore Makefile
|
||||||
|
rm -f "$@"
|
||||||
|
touch "$@"
|
||||||
|
# Skip generated by header, inherit `.prettierignore` header as-is.
|
||||||
|
while read -r rule; do
|
||||||
|
# Remove leading ! if present to simplify rule, added back at the end.
|
||||||
|
tmp="$${rule#!}"
|
||||||
|
ignore="$${rule%"$$tmp"}"
|
||||||
|
rule="$$tmp"
|
||||||
|
case "$$rule" in
|
||||||
|
# Comments or empty lines (include).
|
||||||
|
\#*|'') ;;
|
||||||
|
# Generic rules (include).
|
||||||
|
\*\**) ;;
|
||||||
|
# Site prefixed rules (include).
|
||||||
|
site/*) rule="$${rule#site/}";;
|
||||||
|
./site/*) rule="$${rule#./site/}";;
|
||||||
|
# Rules that are non-generic and don't start with site (rewrite).
|
||||||
|
/*) rule=.."$$rule";;
|
||||||
|
*/?*) rule=../"$$rule";;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
echo "$${ignore}$${rule}" >> "$@"
|
||||||
|
done < "$<"
|
||||||
|
|
||||||
test: test-clean
|
test: test-clean
|
||||||
gotestsum --debug -- -v -short ./...
|
gotestsum --debug -- -v -short ./...
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
|
|
@ -5,7 +5,8 @@ Package `authz` implements AuthoriZation for Coder.
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Authorization defines what **permission** a **subject** has to perform **actions** to **objects**:
|
Authorization defines what **permission** a **subject** has to perform **actions** to **objects**:
|
||||||
- **Permission** is binary: *yes* (allowed) or *no* (denied).
|
|
||||||
|
- **Permission** is binary: _yes_ (allowed) or _no_ (denied).
|
||||||
- **Subject** in this case is anything that implements interface `authz.Subject`.
|
- **Subject** in this case is anything that implements interface `authz.Subject`.
|
||||||
- **Action** here is an enumerated list of actions, but we stick to `Create`, `Read`, `Update`, and `Delete` here.
|
- **Action** here is an enumerated list of actions, but we stick to `Create`, `Read`, `Update`, and `Delete` here.
|
||||||
- **Object** here is anything that implements `authz.Object`.
|
- **Object** here is anything that implements `authz.Object`.
|
||||||
|
@ -22,6 +23,7 @@ A **permission** is always applied at a given **level**:
|
||||||
**Permissions** at a higher **level** always override permissions at a **lower** level.
|
**Permissions** at a higher **level** always override permissions at a **lower** level.
|
||||||
|
|
||||||
The effect of a **permission** can be:
|
The effect of a **permission** can be:
|
||||||
|
|
||||||
- **positive** (allows)
|
- **positive** (allows)
|
||||||
- **negative** (denies)
|
- **negative** (denies)
|
||||||
- **abstain** (neither allows or denies, not applicable)
|
- **abstain** (neither allows or denies, not applicable)
|
||||||
|
@ -29,15 +31,14 @@ The effect of a **permission** can be:
|
||||||
**Negative** permissions **always** override **positive** permissions at the same level.
|
**Negative** permissions **always** override **positive** permissions at the same level.
|
||||||
Both **negative** and **positive** permissions override **abstain** at the same level.
|
Both **negative** and **positive** permissions override **abstain** at the same level.
|
||||||
|
|
||||||
This can be represented by the following truth table, where Y represents *positive*, N represents *negative*, and _ represents *abstain*:
|
This can be represented by the following truth table, where Y represents _positive_, N represents _negative_, and \_ represents _abstain_:
|
||||||
|
|
||||||
| Action | Positive | Negative | Result |
|
| Action | Positive | Negative | Result |
|
||||||
|--------|----------|----------|--------|
|
| ------ | -------- | -------- | ------ |
|
||||||
| read | Y | _ | Y |
|
| read | Y | \_ | Y |
|
||||||
| read | Y | N | N |
|
| read | Y | N | N |
|
||||||
| read | _ | _ | _ |
|
| read | \_ | \_ | \_ |
|
||||||
| read | _ | N | Y |
|
| read | \_ | N | Y |
|
||||||
|
|
||||||
|
|
||||||
## Permission Representation
|
## Permission Representation
|
||||||
|
|
||||||
|
@ -56,18 +57,17 @@ This can be represented by the following truth table, where Y represents *positi
|
||||||
|
|
||||||
## Roles
|
## Roles
|
||||||
|
|
||||||
A *role* is a set of permissions. When evaluating a role's permission to form an action, all the relevant permissions for the role are combined at each level. Permissions at a higher level override permissions at a lower level.
|
A _role_ is a set of permissions. When evaluating a role's permission to form an action, all the relevant permissions for the role are combined at each level. Permissions at a higher level override permissions at a lower level.
|
||||||
|
|
||||||
The following table shows the per-level role evaluation.
|
The following table shows the per-level role evaluation.
|
||||||
Y indicates that the role provides positive permissions, N indicates the role provides negative permissions, and _ indicates the role does not provide positive or negative permissions. YN_ indicates that the value in the cell does not matter for the access result.
|
Y indicates that the role provides positive permissions, N indicates the role provides negative permissions, and _ indicates the role does not provide positive or negative permissions. YN_ indicates that the value in the cell does not matter for the access result.
|
||||||
|
|
||||||
| Role (example) | Site | Org | User | Result |
|
| Role (example) | Site | Org | User | Result |
|
||||||
|-----------------|------|-----|------|--------|
|
| --------------- | ---- | ---- | ---- | ------ |
|
||||||
| site-admin | Y | YN_ | YN_ | Y |
|
| site-admin | Y | YN\_ | YN\_ | Y |
|
||||||
| no-permission | N | YN_ | YN_ | N |
|
| no-permission | N | YN\_ | YN\_ | N |
|
||||||
| org-admin | _ | Y | YN_ | Y |
|
| org-admin | \_ | Y | YN\_ | Y |
|
||||||
| non-org-member | _ | N | YN_ | N |
|
| non-org-member | \_ | N | YN\_ | N |
|
||||||
| user | _ | _ | Y | Y |
|
| user | \_ | \_ | Y | Y |
|
||||||
| | _ | _ | N | N |
|
| | \_ | \_ | N | N |
|
||||||
| unauthenticated | _ | _ | _ | N |
|
| unauthenticated | \_ | \_ | \_ | N |
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,11 @@ RUN mkdir --parents "$GOPATH" && \
|
||||||
go install github.com/goreleaser/goreleaser@v1.6.1 && \
|
go install github.com/goreleaser/goreleaser@v1.6.1 && \
|
||||||
go install mvdan.cc/sh/v3/cmd/shfmt@latest && \
|
go install mvdan.cc/sh/v3/cmd/shfmt@latest && \
|
||||||
# nfpm is used with `make build` to make release packages
|
# nfpm is used with `make build` to make release packages
|
||||||
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
|
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0 && \
|
||||||
|
# yq v4 is used to process yaml files in coder v2. Conflicts with
|
||||||
|
# yq v3 used in v1.
|
||||||
|
go install github.com/mikefarah/yq/v4@v4.30.6 && \
|
||||||
|
mv /tmp/bin/yq /tmp/bin/yq4
|
||||||
|
|
||||||
FROM alpine:3.16 as proto
|
FROM alpine:3.16 as proto
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
|
|
|
@ -51,10 +51,10 @@ The following explains how to do certain things related to dogfooding.
|
||||||
7. To create your own template, you can do: `./scripts/coder-dev.sh templates init` and choose your preferred option.
|
7. To create your own template, you can do: `./scripts/coder-dev.sh templates init` and choose your preferred option.
|
||||||
For example, choosing “Develop in Docker” will create a new folder `docker` that contains the bare bones for starting a Docker workspace template.
|
For example, choosing “Develop in Docker” will create a new folder `docker` that contains the bare bones for starting a Docker workspace template.
|
||||||
Then, enter the folder that was just created and customize as you wish.
|
Then, enter the folder that was just created and customize as you wish.
|
||||||
|
|
||||||
<aside>
|
<aside>
|
||||||
💡 **For all Docker templates:**
|
💡 **For all Docker templates:**
|
||||||
This step depends on whether you are developing on a Coder v1 workspace, versus a Coder v2 workspace, versus a VM, versus locally. In any case, check the output of the command `docker context ls` to determine where your Docker daemon is listening. Then open `./docker/main.tf` and check inside the block `provider "docker"` that the variable `"host"` is set correctly.
|
This step depends on whether you are developing on a Coder v1 workspace, versus a Coder v2 workspace, versus a VM, versus locally. In any case, check the output of the command `docker context ls` to determine where your Docker daemon is listening. Then open `./docker/main.tf` and check inside the block `provider "docker"` that the variable `"host"` is set correctly.
|
||||||
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
|
@ -17,6 +17,7 @@ This lets you quickly test out Coder in a self-contained environment.
|
||||||
- You can use the configuration as-is, or edit it to your liking.
|
- You can use the configuration as-is, or edit it to your liking.
|
||||||
|
|
||||||
This will:
|
This will:
|
||||||
|
|
||||||
- Start an Ubuntu 22.04 VM
|
- Start an Ubuntu 22.04 VM
|
||||||
- Install Docker and Terraform from the official repos
|
- Install Docker and Terraform from the official repos
|
||||||
- Install Coder using the [installation script](https://coder.com/docs/coder-oss/latest/install#installsh)
|
- Install Coder using the [installation script](https://coder.com/docs/coder-oss/latest/install#installsh)
|
||||||
|
|
|
@ -139,4 +139,3 @@ message: |
|
||||||
limactl shell coder
|
limactl shell coder
|
||||||
cd && coder templates init
|
cd && coder templates init
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ This is a list of templates and actions created by the community.
|
||||||
See [Getting Started](./README.md#getting-started) for how to use these templates.
|
See [Getting Started](./README.md#getting-started) for how to use these templates.
|
||||||
|
|
||||||
> If you have created a template, see one that's missing or one that's no longer
|
> If you have created a template, see one that's missing or one that's no longer
|
||||||
maintained, please submit a pull request to improve this list. Thank you!
|
> maintained, please submit a pull request to improve this list. Thank you!
|
||||||
|
|
||||||
## Templates
|
## Templates
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
terraform
|
terraform
|
||||||
typos
|
typos
|
||||||
yarn
|
yarn
|
||||||
|
yq
|
||||||
zip
|
zip
|
||||||
zstd
|
zstd
|
||||||
];
|
];
|
||||||
|
|
|
@ -65,7 +65,8 @@ coder:
|
||||||
|
|
||||||
# coder.resources -- The resources to request for Coder. These are optional
|
# coder.resources -- The resources to request for Coder. These are optional
|
||||||
# and are not set by default.
|
# and are not set by default.
|
||||||
resources: {}
|
resources:
|
||||||
|
{}
|
||||||
# limits:
|
# limits:
|
||||||
# cpu: 100m
|
# cpu: 100m
|
||||||
# memory: 128Mi
|
# memory: 128Mi
|
||||||
|
@ -81,7 +82,8 @@ coder:
|
||||||
#
|
#
|
||||||
# The given key in each secret is mounted at
|
# The given key in each secret is mounted at
|
||||||
# `/etc/ssl/certs/{secret_name}.crt`.
|
# `/etc/ssl/certs/{secret_name}.crt`.
|
||||||
secrets: []
|
secrets:
|
||||||
|
[]
|
||||||
# - name: "my-ca-bundle"
|
# - name: "my-ca-bundle"
|
||||||
# key: "ca-bundle.crt"
|
# key: "ca-bundle.crt"
|
||||||
|
|
||||||
|
@ -103,7 +105,8 @@ coder:
|
||||||
|
|
||||||
# coder.tolerations -- Tolerations for tainted nodes.
|
# coder.tolerations -- Tolerations for tainted nodes.
|
||||||
# See: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
# See: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
tolerations: {}
|
tolerations:
|
||||||
|
{}
|
||||||
# - key: "key"
|
# - key: "key"
|
||||||
# operator: "Equal"
|
# operator: "Equal"
|
||||||
# value: "value"
|
# value: "value"
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
## Swagger / OpenAPI 2 and OpenAPI 3 template parameters
|
|
||||||
|
|
||||||
Note that properties of OpenAPI objects will be in OpenAPI 3.0 form, as
|
|
||||||
Swagger / OpenAPI 2.0 definitions are converted automatically.
|
|
||||||
|
|
||||||
### Code templates
|
|
||||||
|
|
||||||
* `method` - the HTTP method of the operation (in lower-case)
|
|
||||||
* `methodUpper` - the HTTP method of the operation (in upper-case)
|
|
||||||
* `url` - the full URL of the operation (including protocol and host)
|
|
||||||
* `consumes[]` - an array of MIME-types the operation consumes
|
|
||||||
* `produces[]` - an array of MIME-types the operation produces
|
|
||||||
* `operation` - the current operation object
|
|
||||||
* `operationId` - the current operation id
|
|
||||||
* `opName` - the operationId if set, otherwise the method + path
|
|
||||||
* `tags[]` - the full list of tags applying to the operation
|
|
||||||
* `security` - the security definitions applying to the operation
|
|
||||||
* `resource` - the current tag/path object
|
|
||||||
* `parameters[]` - an array of parameters for the operation (see below)
|
|
||||||
* `queryString` - an example queryString, urlEncoded
|
|
||||||
* `requiredQueryString` - an example queryString for `required:true` parameters
|
|
||||||
* `queryParameters[]` - a subset of `parameters` that are `in:query`
|
|
||||||
* `requiredParameters[]` - a subset of `queryParameters` that are `required:true`
|
|
||||||
* `headerParameters[]` - a subset of `parameters` that are `in:header`
|
|
||||||
* `allHeaders[]` - a concatenation of `headerParameters` and pseudo-parameters `Accept` and `Content-Type`, and optionally `Authorization` (the latter has an `isAuth` boolean property set true so it can be omitted in templates if desired
|
|
||||||
|
|
||||||
### Parameter template
|
|
||||||
|
|
||||||
* `parameters[]` - an array of [parameters](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameterObject), including the following pseudo-properties
|
|
||||||
* `shortDesc` - a truncated version of the parameter description
|
|
||||||
* `safeType` - a computed version of the parameter type, including Body and schema names
|
|
||||||
* `originalType` - the original type of the parameter
|
|
||||||
* `exampleValues` - an object containing examples for use in code-templates
|
|
||||||
* `json` - example values in JSON compatible syntax
|
|
||||||
* `object` - example values in raw object form (unquoted strings etc)
|
|
||||||
* `depth` - a zero-based indicator of the depth of expanded request body parameters
|
|
||||||
* `enums[]` - an array of (parameter)name/value pairs
|
|
||||||
|
|
||||||
### Responses template
|
|
||||||
|
|
||||||
* `responses[]` - an array of [responses](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responseObject), including `status` and `meaning` properties
|
|
||||||
|
|
||||||
### Authentication template
|
|
||||||
|
|
||||||
* `authenticationStr` - a simple string of methods (and scopes where appropriate)
|
|
||||||
* `securityDefinitions[]` - an array of applicable [securityDefinitions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#securityRequirementObject)
|
|
||||||
|
|
||||||
### Schema Property template
|
|
||||||
|
|
||||||
* `schemaProperties[]` - an array of
|
|
||||||
* `name`
|
|
||||||
* `type`
|
|
||||||
* `required`
|
|
||||||
* `description`
|
|
||||||
* `enums[]` - an array of (schema property)name/value pairs
|
|
||||||
|
|
||||||
### Common to all templates
|
|
||||||
|
|
||||||
* `openapi` - the top-level OpenAPI / Swagger document
|
|
||||||
* `header` - the front-matter of the Slate/Shins markdown document
|
|
||||||
* `host` - the (computed) host of the API
|
|
||||||
* `protocol` - the default/first protocol of the API
|
|
||||||
* `baseUrl` - the (computed) baseUrl of the API (including protocol and host)
|
|
||||||
* `widdershins` - the contents of widdershins `package.json`
|
|
|
@ -13,7 +13,6 @@ This main.go generates typescript types from the codersdk types in Go.
|
||||||
- [ ] External Types (uses `any` atm)
|
- [ ] External Types (uses `any` atm)
|
||||||
- Some custom external types are hardcoded in (eg: time.Time)
|
- Some custom external types are hardcoded in (eg: time.Time)
|
||||||
|
|
||||||
|
|
||||||
## Type overrides
|
## Type overrides
|
||||||
|
|
||||||
```golang
|
```golang
|
||||||
|
|
|
@ -75,10 +75,22 @@ execrelative() {
|
||||||
return $rc
|
return $rc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependency_check() {
|
||||||
|
local dep=$1
|
||||||
|
|
||||||
|
# Special case for yq that can be yq or yq4.
|
||||||
|
if [[ $dep == yq ]]; then
|
||||||
|
[[ -n "${CODER_LIBSH_YQ:-}" ]]
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
command -v "$dep" >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
dependencies() {
|
dependencies() {
|
||||||
local fail=0
|
local fail=0
|
||||||
for dep in "$@"; do
|
for dep in "$@"; do
|
||||||
if ! command -v "$dep" >/dev/null; then
|
if ! dependency_check "$dep"; then
|
||||||
log "ERROR: The '$dep' dependency is required, but is not available."
|
log "ERROR: The '$dep' dependency is required, but is not available."
|
||||||
fail=1
|
fail=1
|
||||||
fi
|
fi
|
||||||
|
@ -200,9 +212,25 @@ if [[ "${CODER_LIBSH_NO_CHECK_DEPENDENCIES:-}" != *t* ]]; then
|
||||||
log
|
log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Allow for yq to be installed as yq4.
|
||||||
|
if command -v yq4 >/dev/null; then
|
||||||
|
export CODER_LIBSH_YQ=yq4
|
||||||
|
elif command -v yq >/dev/null; then
|
||||||
|
if [[ $(yq --version) == *" v4."* ]]; then
|
||||||
|
export CODER_LIBSH_YQ=yq
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$libsh_bad_dependencies" == 1 ]]; then
|
if [[ "$libsh_bad_dependencies" == 1 ]]; then
|
||||||
error "Invalid dependencies, see above for more details."
|
error "Invalid dependencies, see above for more details."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export CODER_LIBSH_NO_CHECK_DEPENDENCIES=true
|
export CODER_LIBSH_NO_CHECK_DEPENDENCIES=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Alias yq to the version we want by shadowing with a function.
|
||||||
|
if [[ -n ${CODER_LIBSH_YQ:-} ]]; then
|
||||||
|
yq() {
|
||||||
|
command $CODER_LIBSH_YQ "$@"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
|
@ -11,7 +11,6 @@ maintainer: Coder <support@coder.com>
|
||||||
description: |
|
description: |
|
||||||
Provision development environments with infrastructure with code
|
Provision development environments with infrastructure with code
|
||||||
license: AGPL-3.0
|
license: AGPL-3.0
|
||||||
|
|
||||||
suggests:
|
suggests:
|
||||||
- postgresql
|
- postgresql
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,60 @@
|
||||||
###############################################################################
|
# Code generated by Makefile (.gitignore .prettierignore.include). DO NOT EDIT.
|
||||||
# COPY PASTA OF .gitignore
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
.idea
|
# .gitignore:
|
||||||
|
# Common ignore patterns, these rules applies in both root and subdirectories.
|
||||||
|
.DS_Store
|
||||||
|
.eslintcache
|
||||||
.gitpod.yml
|
.gitpod.yml
|
||||||
node_modules
|
.idea
|
||||||
vendor
|
|
||||||
out
|
|
||||||
coverage
|
|
||||||
.next
|
|
||||||
storybook-static
|
|
||||||
test-results
|
|
||||||
**/*.typegen.ts
|
|
||||||
**/*.swp
|
**/*.swp
|
||||||
.coderv2/*
|
gotests.coverage
|
||||||
|
gotests.xml
|
||||||
|
gotestsum.json
|
||||||
|
node_modules/
|
||||||
|
vendor/
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# VSCode settings.
|
||||||
|
**/.vscode/*
|
||||||
|
# Allow VSCode recommendations and default settings in project root.
|
||||||
|
!../.vscode/extensions.json
|
||||||
|
!../.vscode/settings.json
|
||||||
|
|
||||||
|
# Front-end ignore patterns.
|
||||||
|
.next/
|
||||||
|
**/*.typegen.ts
|
||||||
|
build-storybook.log
|
||||||
|
coverage/
|
||||||
|
storybook-static/
|
||||||
|
test-results/
|
||||||
|
|
||||||
|
# Make target for updating golden files.
|
||||||
|
../cli/testdata/.gen-golden
|
||||||
|
|
||||||
|
# Build
|
||||||
|
../build/
|
||||||
|
../dist/
|
||||||
|
out/
|
||||||
|
|
||||||
|
*.tfstate
|
||||||
|
*.tfstate.backup
|
||||||
|
*.tfplan
|
||||||
|
*.lock.hcl
|
||||||
|
.terraform/
|
||||||
|
|
||||||
|
../.coderv2/*
|
||||||
|
**/__debug_bin
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.envrc
|
||||||
|
# .prettierignore.include:
|
||||||
|
# Helm templates contain variables that are invalid YAML and can't be formatted
|
||||||
|
# by Prettier.
|
||||||
|
../helm/templates/*.yaml
|
||||||
|
|
||||||
|
# Terraform state files used in tests, these are automatically generated.
|
||||||
|
# Example: provisioner/terraform/testdata/instance-id/instance-id.tfstate.json
|
||||||
|
**/testdata/**/*.tf*.json
|
||||||
|
|
||||||
|
# Testdata shouldn't be formatted.
|
||||||
|
../scripts/apitypings/testdata/**/*.ts
|
||||||
|
|
|
@ -1,24 +1,60 @@
|
||||||
###############################################################################
|
# Code generated by Makefile (.gitignore .prettierignore.include). DO NOT EDIT.
|
||||||
# COPY PASTA OF .gitignore
|
|
||||||
# https://github.com/prettier/prettier/issues/8048
|
|
||||||
# https://github.com/prettier/prettier/issues/8506
|
|
||||||
# https://github.com/prettier/prettier/issues/8679
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
node_modules
|
# .gitignore:
|
||||||
vendor
|
# Common ignore patterns, these rules applies in both root and subdirectories.
|
||||||
|
.DS_Store
|
||||||
.eslintcache
|
.eslintcache
|
||||||
yarn-error.log
|
|
||||||
.idea
|
|
||||||
.gitpod.yml
|
.gitpod.yml
|
||||||
|
.idea
|
||||||
|
**/*.swp
|
||||||
|
gotests.coverage
|
||||||
|
gotests.xml
|
||||||
|
gotestsum.json
|
||||||
|
node_modules/
|
||||||
|
vendor/
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
# Front-end ignore
|
# VSCode settings.
|
||||||
|
**/.vscode/*
|
||||||
|
# Allow VSCode recommendations and default settings in project root.
|
||||||
|
!../.vscode/extensions.json
|
||||||
|
!../.vscode/settings.json
|
||||||
|
|
||||||
|
# Front-end ignore patterns.
|
||||||
.next/
|
.next/
|
||||||
|
**/*.typegen.ts
|
||||||
|
build-storybook.log
|
||||||
coverage/
|
coverage/
|
||||||
out/
|
|
||||||
storybook-static/
|
storybook-static/
|
||||||
test-results/
|
test-results/
|
||||||
|
|
||||||
**/*.swp
|
# Make target for updating golden files.
|
||||||
.coderv2/*
|
../cli/testdata/.gen-golden
|
||||||
|
|
||||||
|
# Build
|
||||||
|
../build/
|
||||||
|
../dist/
|
||||||
|
out/
|
||||||
|
|
||||||
|
*.tfstate
|
||||||
|
*.tfstate.backup
|
||||||
|
*.tfplan
|
||||||
|
*.lock.hcl
|
||||||
|
.terraform/
|
||||||
|
|
||||||
|
../.coderv2/*
|
||||||
|
**/__debug_bin
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.envrc
|
||||||
|
# .prettierignore.include:
|
||||||
|
# Helm templates contain variables that are invalid YAML and can't be formatted
|
||||||
|
# by Prettier.
|
||||||
|
../helm/templates/*.yaml
|
||||||
|
|
||||||
|
# Terraform state files used in tests, these are automatically generated.
|
||||||
|
# Example: provisioner/terraform/testdata/instance-id/instance-id.tfstate.json
|
||||||
|
**/testdata/**/*.tf*.json
|
||||||
|
|
||||||
|
# Testdata shouldn't be formatted.
|
||||||
|
../scripts/apitypings/testdata/**/*.ts
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"printWidth": 80,
|
|
||||||
"semi": false,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["./README.md", "**/*.yaml"],
|
|
||||||
"options": {
|
|
||||||
"proseWrap": "always"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Code generated by Makefile (../.prettierrc.yaml). DO NOT EDIT.
|
||||||
|
|
||||||
|
# This config file is used in conjunction with `.editorconfig` to specify
|
||||||
|
# formatting for prettier-supported files. See `.editorconfig` and
|
||||||
|
# `site/.editorconfig`for whitespace formatting options.
|
||||||
|
printWidth: 80
|
||||||
|
semi: false
|
||||||
|
trailingComma: all
|
||||||
|
overrides:
|
||||||
|
- files:
|
||||||
|
- ../README.md
|
||||||
|
options:
|
||||||
|
proseWrap: preserve
|
||||||
|
- files:
|
||||||
|
- ./**/*.yaml
|
||||||
|
- ./**/*.yml
|
||||||
|
options:
|
||||||
|
proseWrap: always
|
|
@ -9,9 +9,10 @@
|
||||||
"check:all": "yarn format:check && yarn lint && yarn test",
|
"check:all": "yarn format:check && yarn lint && yarn test",
|
||||||
"chromatic": "chromatic",
|
"chromatic": "chromatic",
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"format:check": "prettier --cache --check '**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
"format:check": "prettier --cache --check '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||||
"format:types": "prettier --write 'src/api/typesGenerated.ts'",
|
"format:types": "prettier --write 'src/api/typesGenerated.ts'",
|
||||||
"format:write": "prettier --write '**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
"format:write": "prettier --write '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||||
|
"format:write:only": "prettier --write",
|
||||||
"lint": "jest --selectProjects lint",
|
"lint": "jest --selectProjects lint",
|
||||||
"lint:fix": "FIX=true yarn lint",
|
"lint:fix": "FIX=true yarn lint",
|
||||||
"playwright:install": "playwright install",
|
"playwright:install": "playwright install",
|
||||||
|
|
Loading…
Reference in New Issue