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

process_output_corrected should not treat \n as reason to empty a file #5415

Closed
jayvdb opened this issue Apr 21, 2018 · 3 comments
Closed

process_output_corrected should not treat \n as reason to empty a file #5415

jayvdb opened this issue Apr 21, 2018 · 3 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Apr 21, 2018

If there is an error on stderr, usually stdout is \n.

process_output_corrected should not interpret \n as intended to be the corrected file being an empty file. It should emit an INFO message to say \n was ignored.

Possibly an extra flag might be added to allow \n to really mean an empty file, if there is no way that the linter ever has an empty file except when it is recommending an empty file (but #2821 , that is almost never correct, which is why it is stupid to let empty files be created.)

c.f. coala/coala-bears#2414 (comment)

Also this will probably fix the regular problems we have with MarkdownBear.

@Makman2
Copy link
Member

Makman2 commented Apr 25, 2018

We can make it even a WARNING message imo. In ideal cases the linter should always provide us a corrected version of a file, even if nothing has changed. If nothing was provided, this usually indicates a flaw where the tool has behaved in error-mode because of bear code.

@Mohit17067
Copy link
Member

I would like to work on this. Please assign me.

@Naveenaidu
Copy link
Member

Can i please be assigned to this issue.

jayvdb added a commit to jayvdb/coala that referenced this issue Oct 30, 2018
If a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed, or when
there was a non-zero exit code.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy, or
ignore known non-zero codes.

Fixes coala#2711
Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 30, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed, or when
there was a non-zero exit code.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy, or
ignore known non-zero codes.

Fixes coala#2711
Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 30, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed, or when
there was a non-zero exit code.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy, or
ignore known non-zero codes.

Fixes coala#2711
Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 31, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed, or when
there was a non-zero exit code.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy, or
ignore known non-zero codes.

Fixes coala#2711
Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 31, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
@jayvdb jayvdb self-assigned this Oct 31, 2018
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 31, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 31, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 31, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 31, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Oct 31, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Nov 1, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Nov 1, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Nov 1, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Nov 2, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
jayvdb added a commit to jayvdb/coala that referenced this issue Nov 12, 2018
When a linter returns an empty stream, it should not be
processed.  In the case of process_output_corrected,
processing it is extremely destructive, zero-ing the
file.  In the other modes, there is no output to be
processed, so it is merely wasted processing.

Also emit warnings for any messages found on a
stream which is not being processed.

Followup enhancements might add ways for linter bears
to skip known messages where a linter is noisy.

Fixes coala#5415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants