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 ```tf
data "coder_git_auth" "github" { module "git-clone" {
id = "github" 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 ```tf
module "git-clone" { module "git-clone" {
@ -38,6 +44,9 @@ module "git-clone" {
version = "1.0.2" version = "1.0.2"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" 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 h1 = false;
let code = false; let code = false;
let paragraph = false; let paragraph = false;
let version = false; let version = true;
for (const token of tokens) { for (const token of tokens) {
if (token.type === "heading" && token.depth === 1) { if (token.type === "heading" && token.depth === 1) {
@ -78,15 +78,12 @@ for (const dir of dirs) {
} }
if (token.type === "code") { if (token.type === "code") {
code = true; code = true;
if (token.lang !== "hcl") { if (token.lang === "tf" && !token.text.includes("version")) {
version = true; version = false;
continue; error(dir.name, "missing version in tf code block");
} }
let text = token.text; if (token.lang === "hcl") {
// check if text contains version error(dir.name, "HCL code blocks are not allowed, use tf");
if (text.includes("version")) {
version = true;
continue;
} }
continue; continue;
} }
@ -101,7 +98,7 @@ for (const dir of dirs) {
error(dir.name, "missing example code block after paragraph"); error(dir.name, "missing example code block after paragraph");
} }
if (!version) { 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 ### Install VS Code Web to a custom folder
```tf ```hcl
module "vscode-web" { module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.2" version = "1.0.2"

Loading…
Cancel
Save