Closed micaherne closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.11%. Comparing base (
f7668d9
) to head (e6d2726
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @micaherne , regarding CRLF ended lines... I think we shouldn't apply for any specific workaround or fix ever.
Moodle files are supposed to be, always, LF ended (Unix ended) and I think that the correct and safe thing to do is to, always, assume that's the case.
If there is any file having other line endings... then for sure some other sniff (Generic.Files.LineEndings
is part of our standard) should detect that and report it, but we cannot make all the code conditional on those wrong line endings.
So it's good that we aren't adding any specific CRLF code here (or elsewhere, ever). IMO. Because that code is not allowed. As simple as that.
Ciao :-)
Thanks @stronk7! I totally agree about CRLF endings - I don't think it makes any sense to add extra code to work around them - I was just a bit confused about how they were affecting the other fixes. But anyway it seems to be giving the expected output with them anyway so I'm happy with that 😄
This patch fixes an issue that contributes to #176 where lines of the boilerplate that should be blank are not identified as wrong if they have text in them.
This is because we are only checking that the lines start with the expected text. I'm not sure why this is but it was this way in the original code before I added the fixes.
I think this fixes #176 in a way, although there is still a weird chain of fixing going on when there's a CRLF in the opening PHP tag. I'll add some more to that issue about it just in case it comes up again.