[WIP] Define and implement a consistent indentation style #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you @zakkak for the input at #29 - I'd like to move the whitespace issue here, and I do fully agree its super annoying.
Personally I think in an ideal world, my editor would do this for me.
Or at least some kind of "make source-format" script I can call before comitting, or put into a git filter so I never forget to call it - I'm already doing this to prevent new line at eof
Good news: The tool "uncrustify" you mentioned is in fact available in debian so I could use it without any hassle : )
Regarding actual indents: If I'm not too lazy to configure my editor correctly, I prefer it does one tab for every indentation level. No "one tab, two space" in between, theres just zero tab, one tab, two tab. Whatever a "tab" means, I should™ be able to adjust in some kind of display-option in my editor's preference (Showing one tab equal to the width of 4 spaces usually is a good fit for me).
The emacs article you linked was quite nice, and seems to agree with my generic view of things -- tabs for "Next code level" and if two things within the same code level have to align, use spaces behind the tabs. (There should never be a reason for two things in different code levels to align, that will rain chaos and
destructionconfusion).If you could help me get started with it, I'd very much like to have some kind of "rules" file so that fixing the layout of the code is one simple command, then run this command once - generating a massive whitespace-changing pull request - and then hook it into pre-commit or my smudge/clean filters.
Not just for this project, but this seems like the kind of thing one wants to keep handy.