Introduce jsonnet-lint
We currently don't have any linter running in CI or even any bash script wrapping jsonnet-lint
.
The main problem with jsonnet-lint
is it digs in to dependencies which would result in vendored files also getting linted showing errors.
For instance:
❯ jsonnet-lint -J libsonnet/ -J vendor/ -J metrics-catalog/ -J services/ libsonnet/servicemetrics/service_level_indicator_definition.libsonnet
vendor/github.com/jsonnet-libs/xtd/url.libsonnet:1:11-43 couldn't open import "doc-util/main.libsonnet": no match locally or in the Jsonnet library paths
local d = import 'doc-util/main.libsonnet';
libsonnet/service-maturity/levels.libsonnet:12:47-103 couldn't open import "autogenerated-service-health-dashboards.json": no match locally or in the Jsonnet library paths
local serviceHealthDashboards = std.parseJson(importstr 'autogenerated-service-health-dashboards.json');
panic: Bug - placeholder for a dependent node cannot be noType
We should look into how we can introduce the linter in the project.
Originally came up from !5549 (comment 1322318144)