JoshuaKGoldberg / TSLint.MSBuild

[Deprecated] An MSBuild task for running TSLint.
https://www.nuget.org/packages/TSLint.MSBuild
MIT License
15 stars 13 forks source link

The timestamp file used for incremental builds should only be touched if tslint succeeds #97

Closed mklefstad closed 5 years ago

mklefstad commented 6 years ago

Say that you have TSLintBreakBuildOnError set to true so that a tslint failure should break the build. If you build and tslint returns that some of the tslint checks failed, then the build will fail. If you build right after that without changing any files, tslint won't execute, and the build will then succeed even though no code has changed and the tslint checks should still fail.

The problem seems to be that the timestamp file used for the incremental build is being touched even when the tslint checks fail. I'd expect to see it only touched if the tslint checks passed, something like:

...
<!-- Moved to after the Exec Task so we can grab the value of TSLintErrorCode -->
<Touch
      AlwaysCreate="true"
      Files="$(TSLintTimestampFile)"
      Condition="'$(TSLintErrorCode)' == '0'"
/>
...

For what it's worth, I'm aware that I could get around this by forcing tslint to run every time with TSLintForceBuild, but I'd much rather keep the incremental build if possible

JoshuaKGoldberg commented 6 years ago

Thanks for reporting this @literallySomeone! Strong +1. Would you like to send a PR fixing the bug?

JoshuaKGoldberg commented 5 years ago

Fixed by #100 ✨