From e5855289de1ac77f2a2f47a9d9739eee6b45e2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Thu, 14 Nov 2024 18:04:34 +0100 Subject: [PATCH 1/4] docs: little clarification on checkers --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de607ca..aecbf0c 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ The detailed result of the checks are described in a [JSON schema](https://grafa - `git` - checks if the directory is git workdir - `versions` - checks for semantic versioning git tags - `build` - checks if k6 can be built with the extension - - `smoke` - checks if the smoke test script exists and runs successfully (`smoke.js`, `smoke.ts`, `smoke.test.js` or `smoke.test.ts` in the `test`,`tests`, `examples` or the base directory) - - `codeowners` - checks if there is a CODEOWNERS file (for official extensions) + - `smoke` - checks if the smoke test script exists and runs successfully (`smoke.js`, `smoke.ts`, `smoke.test.js` or `smoke.test.ts` in the `test`,`tests`, `examples` or in the base directory) + - `codeowners` - checks if there is a CODEOWNERS file (for official extensions) (in the `.github` or `docs` or in the base directory) - `types` - checks if the TypeScript API declaration file exists (`index.d.ts` in the `docs` or the base directory) ## Install From c8f12c89c3af18a44b7634b0ffe1a97801f7abd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Thu, 14 Nov 2024 18:04:47 +0100 Subject: [PATCH 2/4] docs: release notes --- releases/v0.3.0.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 releases/v0.3.0.md diff --git a/releases/v0.3.0.md b/releases/v0.3.0.md new file mode 100644 index 0000000..08676a3 --- /dev/null +++ b/releases/v0.3.0.md @@ -0,0 +1,18 @@ +k6lint `v0.3.0` is here 🎉! + +This version adds two new checkers to the linter: +- **types checker** +- **codeowners checker** + +Improvements: +- The `examples` and `smoke` checks are skipped in the case of output extensions. + +## types checker + +The check is successful if there is TypeScript API declaration file with name `index.d.ts` in `docs` directory or in the base directory. + +## codeowners checker + +The check is successful if there is a `CODEOWNERS` file in one of the GitHub supported directories: `.github` or `docs` or base directory. + +The `codeowners` check is only executed if the `--official` flag is used (or if the `Official` API parameter is `true`). From 500c0b05470f37f76deb0838167eff230fea10b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Thu, 14 Nov 2024 18:08:34 +0100 Subject: [PATCH 3/4] docs: update --- cmd/help.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/help.md b/cmd/help.md index e392a96..2406475 100644 --- a/cmd/help.md +++ b/cmd/help.md @@ -1,6 +1,6 @@ Static analyzer for k6 extensions -k6lint analyzes the source of the k6 extension without building a k6 executable with the extension. +k6lint analyzes the source of the k6 extension and try to build k6 with the extension. By default, text output is generated. The `--json` flag can be used to generate the result in JSON format. From 3385914700abb9e516f873e21d6e412697ec1ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Thu, 14 Nov 2024 18:08:43 +0100 Subject: [PATCH 4/4] docs: update example --- README.md | 26 +++++++++++++++++--------- docs/example.json | 17 +++++++++++------ docs/example.txt | 6 ++++-- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index aecbf0c..4363d67 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,6 @@ Details no `replace` directive in the `go.mod` file ✔ readme found `README.md` as README file -✔ examples - found `examples` as examples directory ✔ license found `LICENSE` as `Apache-2.0` license ✔ git @@ -67,6 +65,10 @@ Details can be built with the latest k6 version ✔ smoke `smoke.test.ts` successfully run with k6 +✔ examples + found `examples` as examples directory +✔ types + found `index.d.ts` file ``` @@ -91,11 +93,6 @@ Details "id": "readme", "passed": true }, - { - "details": "found `examples` as examples directory", - "id": "examples", - "passed": true - }, { "details": "found `LICENSE` as `Apache-2.0` license", "id": "license", @@ -120,11 +117,21 @@ Details "details": "`smoke.test.ts` successfully run with k6", "id": "smoke", "passed": true + }, + { + "details": "found `examples` as examples directory", + "id": "examples", + "passed": true + }, + { + "details": "found `index.d.ts` file", + "id": "types", + "passed": true } ], "grade": "A", "level": 100, - "timestamp": 1731058317 + "timestamp": 1731604019 } ``` @@ -140,7 +147,7 @@ Linter for k6 extensions Static analyzer for k6 extensions -k6lint analyzes the source of the k6 extension without building a k6 executable with the extension. +k6lint analyzes the source of the k6 extension and try to build k6 with the extension. By default, text output is generated. The `--json` flag can be used to generate the result in JSON format. @@ -156,6 +163,7 @@ k6lint [flags] [directory] ``` --passing A|B|C|D|E|F set lowest passing grade (default C) + --official enable extra checks for official extensions -q, --quiet no output, only validation -o, --out string write output to file instead of stdout --json generate JSON output diff --git a/docs/example.json b/docs/example.json index 3cfa35c..4cf671e 100644 --- a/docs/example.json +++ b/docs/example.json @@ -15,11 +15,6 @@ "id": "readme", "passed": true }, - { - "details": "found `examples` as examples directory", - "id": "examples", - "passed": true - }, { "details": "found `LICENSE` as `Apache-2.0` license", "id": "license", @@ -44,9 +39,19 @@ "details": "`smoke.test.ts` successfully run with k6", "id": "smoke", "passed": true + }, + { + "details": "found `examples` as examples directory", + "id": "examples", + "passed": true + }, + { + "details": "found `index.d.ts` file", + "id": "types", + "passed": true } ], "grade": "A", "level": 100, - "timestamp": 1731058317 + "timestamp": 1731604019 } diff --git a/docs/example.txt b/docs/example.txt index cfc1003..cfdcd2a 100644 --- a/docs/example.txt +++ b/docs/example.txt @@ -10,8 +10,6 @@ Details no `replace` directive in the `go.mod` file ✔ readme found `README.md` as README file -✔ examples - found `examples` as examples directory ✔ license found `LICENSE` as `Apache-2.0` license ✔ git @@ -22,4 +20,8 @@ Details can be built with the latest k6 version ✔ smoke `smoke.test.ts` successfully run with k6 +✔ examples + found `examples` as examples directory +✔ types + found `index.d.ts` file