Skip to content

Commit

Permalink
Merge pull request #18 from grafana/14-prepare-v0.3.0
Browse files Browse the repository at this point in the history
Prepare v0.3.0
  • Loading branch information
szkiba authored Nov 14, 2024
2 parents ecf1217 + 3385914 commit 392b718
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 20 deletions.
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
```

Expand All @@ -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",
Expand All @@ -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
}
```
</details>
Expand All @@ -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.

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/help.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
17 changes: 11 additions & 6 deletions docs/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
}
6 changes: 4 additions & 2 deletions docs/example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

18 changes: 18 additions & 0 deletions releases/v0.3.0.md
Original file line number Diff line number Diff line change
@@ -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`).

0 comments on commit 392b718

Please sign in to comment.