Thank you for your interest in contributing to k6lint!
Before you begin, make sure to familiarize yourself with the Code of Conduct. If you've previously contributed to other open source project, you may recognize it as the classic Contributor Covenant.
The tools listed in the tools section should be installed before contributing. It is advisable to first install the cdo tool, which can be used to easily perform the tasks described here. The cdo tool can most conveniently be installed using the eget tool.
eget szkiba/cdo
The cdo tool can then be used to perform the tasks described in the following sections.
Help about tasks:
cdo
Contributing will require the use of some tools, which can be installed most easily with a well-configured eget tool.
eget mikefarah/yq
eget atombender/go-jsonschema
eget szkiba/mdcode
eget golangci/golangci-lint
eget goreleaser/goreleaser
The JSON schema of the compliance test can be found in the [compliance.schema.yaml] file, after modification of which the schema in JSON format (compliance.schema.json) and the golang data model (compliance_gen.go) must be regenerated.
yq -o=json -P docs/compliance.schema.yaml > docs/compliance.schema.json
go-jsonschema --capitalization ID -p k6lint --only-models -o compliance_gen.go docs/compliance.schema.yaml
After changing the CLI tool or examples directory, the documentation must be updated in README.md.
go run ./tools/gendoc README.md
mdcode update README.md
The golangci-lint
tool is used for static analysis of the source code.
It is advisable to run it before committing the changes.
golangci-lint run
go test -count 1 -race -coverprofile=coverage.txt ./...
Requires : test
go tool cover -html=coverage.txt
This is the easiest way to create an executable binary (although the release process uses the goreleaser
tool to create release versions).
go build -ldflags="-w -s" -o k6lint ./cmd/k6lint
The goreleaser command-line tool is used during the release process. During development, it is advisable to create binaries with the same tool from time to time.
goreleaser build --snapshot --clean --single-target -o k6lint
rm -rf build
The most robust thing is to update everything after modifying the source.
Requires : schema, readme