testmycode / tmc-core

The common clientside implementation for tmc-clients. Used by the tmc-netbeans and the tmc-cli
3 stars 18 forks source link

Downloaded exercises have incorrect newline char on Windows #107

Closed jclc closed 8 years ago

jclc commented 8 years ago

Files use the Unix newline "\n" when they should be using Windows newline "\r\n". This causes files to display incorrectly on certain programs that lack Unix newline support, such as notepad.

ljleppan commented 8 years ago

I'm somewhat tempted to label this as wontfix, since mangling/repairing newline characters on this level of the stack might have unexpected consequences in some cases. I'd rather leave fixing this to the individual clients.

On the other hand, if this ends up being something that has to be done in multiple clients, it'd be more sensible to have it done on this level rather than replicating the feature in all the clients.

My suggestion is that if this feature is implemented, we implement it in tmc-cli right now, and migrate it to tmc-core later if needed.

Any input from @jamox?

jamo commented 8 years ago

I would say that the newlines etc. are something the exercise creators should be responsible to take care of, if they feel like it. And tmc- should just make sure that it won't tamper with the files (encoding/permissions/newlines etc).

However, should this fix ever be done,(it likely won't) it should be a pre submit/commit hook on the source repo, not something that will be done on students' computer.

Also, AFAIK the notepad.exe is the only somewhat commonly used editor that can't deal with unix newlines, and it's a horrible editor, so the impact of this inconvenience is super small.

jamo commented 8 years ago

(not a bug, so I can't apply the wont-fix)