Apply a consistent format across the repo#246
Open
caitlinross wants to merge 6 commits into
Open
Conversation
clang-format is now the single source of truth for layout, so the per-file modelines (118 of them, all variations of 'Local variables: / c-indent-level / vim: ts=8 sts=4 ...') are obsolete and would conflict with .clang-format if their values ever drifted. Pure deletions across 118 files; no code touched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The formatting is highly inconsistent across the whole repo. Many files also have vim/emacs modelines. Every time I want to make an edit in a file, my editor wants to apply a ton of changes which is very annoying and makes it difficult to look at diffs. So I removed the modelines, and formatted the code using clang-format. There is also now a clang-format check in CI so we can enforce this in PRs.
I also added the two commits making these changes to a file that will make git blame ignore these code changes so git blame is still useful.
I also added some info on code formatting to the README. It explains how to set up your editor to use clang-format as well as how to run it manually.