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

fix outputFile for multiple source files #31

Merged
merged 4 commits into from
Aug 24, 2016

Conversation

gronke
Copy link
Contributor

@gronke gronke commented Oct 29, 2015

  • introduces Unit-Tests using Mocha and Chai.expect
  • fixes handling of multiple files writing to an outputFile

Description

When running on multiple source files reporting to a shared outputFile, only the output of the latest file was stored, because the file was deleted on each iteration.

tslint: {
    stdout: {
        options: {
            configuration: grunt.file.readJSON("tslint.json")
        },
        files: {
            src: ["*.ts"]
        }
    },
    file: {
        options: {
            configuration: grunt.file.readJSON("tslint.json"),
            outputFile: '/tmp/outputFile'
        },
        files: {
            src: ["*.ts"]
        }
    }
}

Expected Result:

  • the errors written to tmp/outputFile are the same as printed to stdout

Fix

After the report of the first queued file was written, the appendToOutput option is set to true, so that the further output is appended to the file.

@adidahiya adidahiya self-assigned this Oct 29, 2015
@gronke
Copy link
Contributor Author

gronke commented Nov 8, 2015

@adidahiya I'd like to cover more features with tests and would like to fork from this branch. Would be easier if the test setup s merged to master first, so that Pull-Request do not duplicate the changes.

@gronke gronke force-pushed the report-multiple-source-files branch 3 times, most recently from fc104f3 to a1c805f Compare August 18, 2016 04:33
@gronke
Copy link
Contributor Author

gronke commented Aug 20, 2016

@adidahiya this one looks ready to merge. #52 is implementing the same feature, but without the tests. What do you think?

@Cayan
Copy link

Cayan commented Aug 20, 2016

@gronke I'm sorry for any inconveniences, I didn't mean to be disrespectful or anything like it.
The first commit from #52 and this PR, both generate an invalid XML (CheckStyle or PMD formatter).
Which generates a bug. Those format types are used with a third party and with an invalid file something that would be working, poorly, but working would completely stop working at all.

Grunt-TSLint depends on TSLint, the solution for this problem needs be merged there first. There is one opened PR with it: palantir/tslint/pull/1472

Edit: #52 has been closed.

@gronke
Copy link
Contributor Author

gronke commented Aug 20, 2016

@Cayan no worries about anything please 😜 I'm using a fork of this plugin and lost sight of keeping the branch rebased. #52 was a nice reminder to rebase and clean up the pull-request, because obviously it's not only me waiting for the fix. My question from the previous comment should just make sure it's not the unit tests blocking this PR from being merged.

@jkillian
Copy link
Contributor

Thanks for the PR @gronke, this looks good to me, I think it can be merged. Of course palantir/tslint#1472 will help remedy some more issues, but that doesn't hold this back

@jkillian jkillian merged commit 85afb94 into palantir:master Aug 24, 2016
@gronke gronke deleted the report-multiple-source-files branch September 18, 2016 11:12
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