dRonin
dRonin copied to clipboard
RFC: Indentation & PR-checks
So, there's been a lot of discussion that we should have PRs verify correct indentation automatically.
It's difficult when there is a lot of existing code that is not indented properly.
There's been discussion that we should do a "big reindent" of the code, but this will conflict with work in progress.
I suggest this for post-renatus:
- we introduce a PR check that makes sure that on already-perfectly-indented flight files that no lines are improperly indented. This will minimize pain. (We need to also be sure to exempt upstream stuff)
- we re-indent PiOS and a few other infrequently changing places right away
- we re-indent much more of flight near the end of the release if things go well.
For now we can ignore ground.
Thoughts?
I'm very much in favor of having tools do this. Spoiled by gofmt.
On Thu, Dec 24, 2015, 11:41 Michael Lyle [email protected] wrote:
So, there's been a lot of discussion that we should have PRs verify correct indentation automatically.
It's difficult when there is a lot of existing code that is not indented properly.
There's been discussion that we should do a "big reindent" of the code, but this will conflict with work in progress.
I suggest this for post-renatus:
- we introduce a PR check that makes sure that on already-perfectly-indented flight files that no lines are improperly indented. This will minimize pain. (We need to also be sure to exempt upstream stuff)
- we re-indent PiOS and a few other infrequently changing places right away
- we re-indent much more of flight near the end of the release if things go well.
For now we can ignore ground.
Thoughts?
— Reply to this email directly or view it on GitHub https://github.com/d-ronin/dRonin/issues/343.
Doing this kind of cleanups kills attribution (obvious attribution i.e. the output of git blame). Why not just run the check against changed lines? Sure it will end up with files having mixed styles but it will increasingly get better while keeping proper attribution.
For the most part git blame -w
will keep the correct attribution.