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

Fix: Use error templates even when reading from stdin (fixes #7213) #7223

Merged
merged 1 commit into from Sep 28, 2016

Conversation

not-an-aardvark
Copy link
Member

@not-an-aardvark not-an-aardvark commented Sep 23, 2016

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

See #7213 for template answers.

Please check each item to ensure your pull request is ready:

  • I've read the pull request guide
  • I've included tests for my change
  • (n/a) I've updated documentation for my change (if appropriate)

What changes did you make? (Give an overview)

This updates bin/eslint.js to treat stdin errors like all other errors. ESLint has a generic process.on('uncaughtException') handler that handles error templates, but previously the code for the stdin flag had its own error handling logic. This PR removes the error handling logic from stdin, which allows stdin errors to cascade to the uncaughtException handler.

Is there anything you'd like reviewers to focus on?

This PR should not be merged yet, as it still needs tests. However, I didn't notice any existing tests for bin/eslint.js. Is there a file with tests that I missed, or should I create a new one?

edit: The PR now has tests.

@mention-bot
Copy link

@not-an-aardvark, thanks for your PR! By analyzing the annotation information on this pull request, we identified @nzakas, @shumphrey and @ilyavolodin to be potential reviewers

@eslintbot
Copy link

LGTM

@platinumazure
Copy link
Member

Hmm. Are there any other tests we can run to try to force other errors (which should have "pretty" output) to be thrown while piping code in? The original discussion is about one use case, so it'd be great to have at least a manual test showing another possible case. (Example: Finding nonexistent plugin, maybe?)

@eslintbot
Copy link

LGTM

@not-an-aardvark
Copy link
Member Author

not-an-aardvark commented Sep 23, 2016

Updated the PR to add some tests for the bin/eslint.js file.

edit: Oops, CI is failing for Node 4 and 5 -- I think the child_process API might have changed in Node 6. Will investigate now. (edit: this is fixed now)

@eslintbot
Copy link

LGTM

@vitorbal vitorbal added bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 26, 2016
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just would like another set of eyes.

@ilyavolodin ilyavolodin merged commit 85b8714 into eslint:master Sep 28, 2016
@not-an-aardvark not-an-aardvark deleted the stdin-error-messages branch September 28, 2016 23:30
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants