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

PrettierLintBear.py: Fix syntax error regex #2414

Merged
merged 1 commit into from
Apr 21, 2018

Conversation

saksham189
Copy link
Contributor

Fixes #2365

For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!

Checklist

  • I read the commit guidelines and I've followed
    them.
  • I ran coala over my code locally. (All commits have to pass
    individually.
    It is not sufficient to have "fixup commits" on your PR,
    our bot will still report the issues for the previous commit.) You will
    likely receive a lot of bot comments and build failures if coala does not
    pass on every single commit!

After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.

Please consider helping us by reviewing other peoples pull requests as well:

The more you review, the more your score will grow at coala.io and we will
review your PRs faster!

@@ -23,13 +23,17 @@ class PrettierLintBear:
'Multi-line objects'}
SEE_MORE = 'https://prettier.io/'

regex = re.compile(r'L(?P<line>\d+)C(?P<column>\d+): (?P<message>.*)')
Copy link
Member

@jayvdb jayvdb Apr 10, 2018

Choose a reason for hiding this comment

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

im wondering how this could have been so wrong?
see issue

Copy link
Member

Choose a reason for hiding this comment

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

resolved

yield from self.process_output_corrected(stdout, filename, file)
yield from self.process_output_regex(stderr, filename, file,
self.regex)
if stdout == '\n':
Copy link
Member

Choose a reason for hiding this comment

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

why is this if needed?

Copy link
Contributor Author

@saksham189 saksham189 Apr 10, 2018

Choose a reason for hiding this comment

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

When there is a syntax error stdout has a \n. So we should only show the syntax error result.

Copy link
Member

Choose a reason for hiding this comment

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

But the regex being applied to stdout will ignore the \n..?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no we are using process_output_corrected since the bear prints corrected output to stdout

Copy link
Member

Choose a reason for hiding this comment

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

That feels like a bug in process_output_corrected. If there was an error, the linter can only emit \n on stdout. It shouldnt decide that means the file should be blanked.

Copy link
Member

Choose a reason for hiding this comment

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

@jayvdb
Copy link
Member

jayvdb commented Apr 21, 2018

@gitmate-bot ff

@gitmate-bot
Copy link
Collaborator

Hey! I'm GitMate.io! This pull request is being fastforwarded automatically. Please DO NOT push while fastforward is in progress or your changes would be lost permanently ⚠️

@gitmate-bot
Copy link
Collaborator

Automated fastforward failed! Please fastforward your pull request manually via the command line.

Reason:

Command: git merge --ff-only head/2365

Exit Code: 128

Cause:

fatal: Not possible to fast-forward, aborting.


@jayvdb
Copy link
Member

jayvdb commented Apr 21, 2018

@gitmate-bot rebase

@gitmate-bot
Copy link
Collaborator

Hey! I'm GitMate.io! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost permanently ⚠️

@gitmate-bot
Copy link
Collaborator

Automated rebase with GitMate.io was successful! 🎉

@jayvdb
Copy link
Member

jayvdb commented Apr 21, 2018

@gitmate-bot ff

@gitmate-bot
Copy link
Collaborator

Hey! I'm GitMate.io! This pull request is being fastforwarded automatically. Please DO NOT push while fastforward is in progress or your changes would be lost permanently ⚠️

@gitmate-bot
Copy link
Collaborator

Automated fastforward with GitMate.io was successful! 🎉

@gitmate-bot gitmate-bot merged commit 8570505 into coala:master Apr 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

PrettierLintBear regex is incorrect
3 participants