Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
NewlineAtEndOfFile default should be OS agnostic #4073
Currently the default for
If someone very definitely wanted a certain EOL type, then surely they need a (new?) check which confirms all EOLs throughout all files are using that EOL type, not merely the EOLs at EOF as done by
That will mean the ruleset https://raw.githubusercontent.com/noveogroup/android-check/master/android-check-plugin/src/main/resources/checkstyle/checkstyle-hard.xml will work as is on Windows, without depending on the git config of the users or requiring creation of
I also second this request.
Currently the default is
So I'd suggest to change the default of this check to
referenced this issue
Mar 5, 2019
In my case, I am not asking for myself, but because I want source analysers and test suites that are not dependent on how the files were checked out, unless the user quite explicitly wants that. Usually EOL settings on Windows are a user preference.
Other rulesets inherit the default of this rule, so they get the strange sets of behaviour of this rule without realising it. It isnt easy to find the problem - it took me a while to realise why the windows machines were having problems. Other rulesets could change the default by using the more permissive value, but then I need to raise this type of issue with each published ruleset which other users are using.
Changing NewlineAtEndOfFile to be more permissive of all types of EOL isnt likely to break anyone; more likely is the inverse -- someone expecting it to enforce system EOL would have that expectation removed by the default change.
But as explained above, that possible person really shouldnt be relying on this rule to enforce system EOL, as this rule is only about the end-of-file-EOL. A checker for the type of EOL used should apply to all of the EOLs in the file, not just the final EOL.
@romani of course we can adjust the config.