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

test runner - separate diagnostics #159

Open
KFlash opened this issue Jul 25, 2021 · 8 comments
Open

test runner - separate diagnostics #159

KFlash opened this issue Jul 25, 2021 · 8 comments
Assignees

Comments

@KFlash
Copy link
Contributor

KFlash commented Jul 25, 2021

All diagnostics in test runner is seen as an error. Need to separate this.

If 'DiagnosticKind' === 16 should trigger error diagnostics.

If the value is '64' should for example output

Lint
----

Everything is okay

if the value is '8' should output an warning:

Warning
----

'eval' can be unsafe here
@KFlash
Copy link
Contributor Author

KFlash commented Jul 26, 2021

@aladdin-add the linter diagnostics is not an error so should not prevent printing. I tested this now and the linter diagnostics blocking printing.

As seen in this picture everything is generated as an error.

I'm using my own reporter for this.

errors

@KFlash
Copy link
Contributor Author

KFlash commented Jul 26, 2021

Linting and error seen together

hint_error

@aladdin-add
Copy link
Collaborator

but IMHO better not to mix the linting errors to the diagnostics. linting should be another public API?

@KFlash
Copy link
Contributor Author

KFlash commented Jul 26, 2021

All diagnostics are just numbers. It's up to end users how to deal with them.

What do you mean with 'linting should be another public API?'

@aladdin-add
Copy link
Collaborator

#88 (comment)

@aladdin-add
Copy link
Collaborator

just my two cents. I can adjust the tests if you prefer the one API for all the things. :)

@KFlash
Copy link
Contributor Author

KFlash commented Jul 26, 2021

I prefer not to kill performance and many "rules" in e. g. ESLint is parser errors.

The diagnostics is just diagnostics and does everything in one go instead of walk the tree, consume memory and kill performance twice.

This is best seen in an Editor where you can separate the diagnostics, and when it comes to public API. There are no problem to add a kataw.lint() and in the CLI use the reporter to only show diagnostics for linting and ignore all errors. Then it's equal to ESLint

Here is an "eslint look a like" example

eslint

@KFlash
Copy link
Contributor Author

KFlash commented Jul 30, 2021

@aladdin-add friendly ping

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