Closed JeanFTP closed 1 year ago
Hi Jean - do you have any suggestions how that could work?
We already have a hash check to see if files were modified, and I believe whitespace/EOL would affect that as well. I think even MSBuild would recompile on whitespace changes in .cs
files.
Quite easy :
Replace result.CompiledContent == await File.ReadAllTextAsync(newFile))
with RemoveEndOfLines(result.CompiledContent) == RemoveEndOfLines(await File.ReadAllTextAsync(newFile))
And add:
static string RemoveEndOfLines(string s)
=> string.Join("", string.Split(new[] { '\r' }, s, StringSplitOptions.RemoveEmptyEntries));
Needs to be tested, but this should work.
or I just found out that there is a new method "".ReplaceLineEndings()
which may be simpler: result.CompiledContent.ReplaceLineEndings() == (await File.ReadAllTextAsync(newFile)).ReplaceLineEndings()
@johan-v-r Would that be a reasonable change for you ? On our side it is really a pain to have css changes every compilation when switching branches
Looks good thanks for the PR! Will update shortly
Great, however I believe you havean issue with the CI :)
@johan-v-r
Using Git & Visual Studio, it happens often when changing branches that css files are re-generated even if only white space or end-of-line changes are found. It is kind of anoying when you combine with git use, as it finds modified files when it is actalluy the same. Is there a way to avoid this behavior? And if not, would it be possible to implement an option for this?