add linting

pull/128/head
Muhammad Atif Ali 1 year ago
parent 6c023c0368
commit f2b92f2db2

@ -20,17 +20,23 @@ module "git-clone" {
}
```
To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-providers), add the provider by ID to your template:
## Examples
### Custom Path
```tf
data "coder_git_auth" "github" {
id = "github"
module "git-clone" {
source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.2"
agent_id = coder_agent.example.id
url = "https://github.com/coder/coder"
base_dir = "~/projects/coder"
}
```
## Examples
### Git Authentication
### Custom Path
To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-providers), add the provider by ID to your template:
```tf
module "git-clone" {
@ -38,6 +44,9 @@ module "git-clone" {
version = "1.0.2"
agent_id = coder_agent.example.id
url = "https://github.com/coder/coder"
base_dir = "~/projects/coder"
}
data "coder_git_auth" "github" {
id = "github"
}
```

@ -62,7 +62,7 @@ for (const dir of dirs) {
let h1 = false;
let code = false;
let paragraph = false;
let version = false;
let version = true;
for (const token of tokens) {
if (token.type === "heading" && token.depth === 1) {
@ -78,15 +78,12 @@ for (const dir of dirs) {
}
if (token.type === "code") {
code = true;
if (token.lang !== "hcl") {
version = true;
continue;
if (token.lang === "tf" && !token.text.includes("version")) {
version = false;
error(dir.name, "missing version in tf code block");
}
let text = token.text;
// check if text contains version
if (text.includes("version")) {
version = true;
continue;
if (token.lang === "hcl") {
error(dir.name, "HCL code blocks are not allowed, use tf");
}
continue;
}
@ -101,7 +98,7 @@ for (const dir of dirs) {
error(dir.name, "missing example code block after paragraph");
}
if (!version) {
error(dir.name, "missing version in code block");
error(dir.name, "missing version in tf code block");
}
}

@ -26,7 +26,7 @@ module "vscode-web" {
### Install VS Code Web to a custom folder
```tf
```hcl
module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.2"

Loading…
Cancel
Save