Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Always write lint result. (#1353) #1463

Closed
wants to merge 1 commit into from
Closed

Always write lint result. (#1353) #1463

wants to merge 1 commit into from

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Aug 7, 2016

Ensures that the result is always written to the output stream, even if there were no failures.

@jkillian
Copy link
Contributor

jkillian commented Aug 8, 2016

[Fixes #1353]

@jkillian
Copy link
Contributor

jkillian commented Aug 8, 2016

Does this give reasonable output for all formatters when there are no failures? For example, I'm wondering if the msBuild and prose formatters should really be outputting a single \n when there are no failures.

@caugner
Copy link
Contributor Author

caugner commented Aug 8, 2016

As I see it, this PR is only about correctly writing out the formatter's result in any case.

If there are formatters that don't give reasonable output for an empty failure list, this would be a bug in the formatter, which should be addressed separately. But as far as I can see, there aren't any obvious bugs in the included formatters, and the trailing \n actually does make sense, because text files should always end with a newline.

@jkillian
Copy link
Contributor

jkillian commented Aug 9, 2016

Ah, I do see one issue actually, although it's related to another bug. TSLInt via the CLI doesn't handle output very well for multiple files: #656

With this change, formatters will output lots of extraneous output, because they'll output something for every file without errors. For the formatters mentioned above, we'll get a blank line for each file without failures, which will end up being a lot of blank lines.

What do you think @caugner? If we had a fix for #656 I would merge this right away, but I'm a little worried given #656.

@jkillian
Copy link
Contributor

jkillian commented Sep 1, 2016

Closing this as it's included in #1472

@alexeagle
Copy link
Contributor

True that text files should end with a newline, but if I run tslint on the command line, there is no text file, just a non-empty stdout.

tpanningnextcen added a commit to NextCenturyCorporation/neon-gtd that referenced this pull request Jan 4, 2017
If there are no errors, tslint outputs an empty file instead of a valid
XML file with no entries:
  palantir/tslint#1463
The empty file causes Jenkins to fail. This is fixed in tslint 4.x, but
that requires upgrading some other tools and updating the lint file.
This is a quick fix while we work on other things.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants