Initial basic editorconfig support#3212
Conversation
Specify only: - unix line endings - insert final newlines - UTF-8 encoding
There were only 4 files that didn't use UNIX line endings, found with the `editorconfig-checker` tool. Changed with: perl -pi -e 's/\r$//' cmake/modules/windows/FindHDF5.cmake docs/obsolete/fan_utils.html docs/old/netcdf-internal.texi docs/static-pages/orgs.html
Found with `editorconfig-checker` checker tool. Fixed manually.
|
I don't know Ward and I have noticeably different coding styles. |
There are no changes to coding styles here, in this initial PR. If we choose, it could be used to bring more uniform indentation though. I notice a lot of the codebase has screwed up indentation... |
Friendly ping. @WardF @DennisHeimbigner |
|
I think any effort on code formatting is very valuable for external contributors! I'd even support checks via pre commit hook |
$0.02 from the peanut gallery: Multiple styles in a single code-base is a bug, not a feature. Long-term sustainability for the project is helped by making it as easy as possible to on-board new contributors. |
|
Taking a look now. I was unfamiliar with this, and was prioritizing other tasks. Looking now. |
|
@WardF great, thanks! With this basic initial pass accepted, the next pass I'd propose is enabling the setting to delete all trailing whitespace... sound ok? |
|
THis is a great idea. Different code styles are not great... |
|
Give them an inch... |
|
I gave it a quick try, and there is in fact a lot of trailing whitespace. This is easily remedied with a perl one liner like I could make such an MR, but it's of course super tedious to review. Could also be a sneaky way to insert a vulnerability. :) Perhaps @WardF or @DennisHeimbigner you'd prefer to do so yourself? |
|
May as well just show the result: eefa097 |
Funny, that's what I usually say about the Unidata dev team 😆 |
|
I think any objective observer of the code will conclude that my code has perfect style, and I recommend it be used as the template for correct style, not just in the netcdf-c and netcdf-fortran projects, but everywhere. However, in case there are (incredibly!) any other opinions, I'm willing to work to any common style, even one noticeably worse than my own. @seanm I think you have found the correct method to move forward: pick one improvement at a time. Removing whitespace at the end of the lines is a great starting point. I applaud your efforts and urge you to dig in for the long haul on this one. |
rotfl :)
Yeah, it seems like something that's hard to argue has any benefit, so easier to get agreement on removing. And, as I said, can be done with a perl one-liner. Ideally by one of the core maintainers so as to allow skipping any human tediously reviewing an external contribution. |
|
Currently there is only one maintainer of this repo, @ward. All others working on netcdf-c are outside of Unidata and don't have the ability to apply these changes. |
|
@WardF for what it's worth, and yeah. I'm working as quick as I can, but the main issue right now is to get through the other meatier ones that have lingered during holiday/grant writing/AGU season. I will see about getting the others in ASAP, but from a priority standpoint, we're a single threaded process and right this second I'm wiring in HDF5 2.0.0 stuff into our local test infrastructure, which will feed into our automated test infrastructure, and no doubt work perfectly and not result in any additional overhead or tasks ;). That said, even small changes have an overhead that takes a bit of time. Honestly though, I'd rather have all this work to do than not have anything to do. As @captainkirk99 no doubt will attest, working on netCDF is extremely rewarding, and I am grateful for all of the contributions and effort people put in. The work you all collectively do deserves my full attention, and also the work others do deserves my full attention so as to not foul up the work you are trying to do simply because I rushed and accepted something without really thinking it through :). I'm trying to clear the backlog before EOY. Let's see what happens. |
If you've never heard of it: https://editorconfig.org/