google / google/go-jsonnet

jsonnet-lint: filename context missing for shortcut function definitions

Open
#546 0 comments 0 reactions 0 assignees View on GitHub
bug error reporting linter
Dominant language
Go
Stars
1.8k
Forks
263
PR merge metrics
No merged PRs in 30d

Description

For long form functions, this works fine.
```
$ cat bar.jsonnet
local bar = function (str) { bar: str };
{}
$ jsonnet-lint bar.jsonnet
bar.jsonnet:1:7-40 Unused variable: bar

local bar = function (str) { bar: str };

Problems found!
```

Using short form definition misses the filename context in the message

```
$ cat foo.jsonnet
local dofoo(str) = { foo: str };
{}
$ jsonnet-lint foo.jsonnet
Unused variable: dofoo

Problems found!
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.