Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meaningless error message Error: Illegal value for line #3

Closed
ezh opened this issue Sep 18, 2021 · 5 comments
Closed

Meaningless error message Error: Illegal value for line #3

ezh opened this issue Sep 18, 2021 · 5 comments

Comments

@ezh
Copy link

ezh commented Sep 18, 2021

There is a basic golang linter:

		"any-lint.linters": [
			{
				"name": "golint",
				"binPath": "golint",
				"condition": "$.fileExtname == '.go'",
				"args": [
					"${fileDirname}/..."
				],
				"diagnostic": {
					"output": "stdout",
					"type": "lines",
					"format": "${file}:${startLine}:${startColumn}: ${message}",
				}
			}
		]

I get the next message on any-lint console

golint /Users/john/app/pkg/endpoint/...
/Users/john/app/pkg/endpoint/new.go:3:1: exported function New should have comment or be unexported

failed to convert to diagnostic
Error: Illegal value for `line`

/Users/john/app/pkg/endpoint/new.go:3:1: exported function New should have comment or be unexported is the single line message on STDOUT from golint. There are no leading or trailing lines.

@ezh
Copy link
Author

ezh commented Sep 18, 2021

Is there any hint on how to fix it?

@ezh
Copy link
Author

ezh commented Sep 18, 2021

Actually, it doesn't depend on 'golint'. I see that other line linters are failed as well.

@tamayika
Copy link
Owner

In my environment(Windows, macOS, Linux), it works with provided configuration.
(In Windows I can't specify ... for args by access error, so I removed it)

If you can debug extension, please see https://github.com/tamayika/vscode-any-lint/blob/main/src/linter.ts#L154-L155 error's stacktrace.

  1. Clone this repo
  2. cd vscode-any-lint && npm install
  3. code . to launch vscode
  4. Set breakpoint to https://github.com/tamayika/vscode-any-lint/blob/main/src/linter.ts#L154-L155
  5. Press F5 to launch test vscode instance
  6. Move to your directory in test vscode instance
  7. Save the document and lint it in test vscode instance
  8. Breakpoint is hit and see the stack trace

@ezh
Copy link
Author

ezh commented Oct 1, 2021

@tamayika Thank you for the instructions. 💯
I'm sorry for the noise.
I'll try to reproduce and collect all necessary debug information.

@ezh ezh closed this as completed Oct 1, 2021
@ezh
Copy link
Author

ezh commented Oct 1, 2021

I thought that It might be worse to add details to the error message in the vscode console for end-users. So someone could understand errors without a debugger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants