-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clang format to clean up code #39
Add clang format to clean up code #39
Conversation
…ude`s to top of .ino file ...and alphabetize them
…g-format.sh scripts
I set every single setting, meticulously going through this documentation online to do so: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
…on 11 of clang-format but I only have version 6 Version 6 Style Options documentation is here: https://releases.llvm.org/6.0.1/tools/clang/docs/ClangFormatStyleOptions.html I had to comment out or modify every line that was giving a clang-format error when running clang-format. These lines I commented out or changed are apparently only for version 11, but I have version 6.
1. AlwaysBreakAfterReturnType - change from "All" to "None", as All was an accident and makes functions look like this: void main() { } instead of this: void main() { } None is really what I want for sure. 2. IndentPPDirectives - change from "BeforeHash" to "AfterHash", as "BeforeHash" isn't supported on clang-format v6 (only on later versions), and "AfterHash" is good enough.
…out getting a good editor I explained how to set tab size in Arduino IDE from 2 to 4, but also recommended just getting a good editor, and setting the IDE to "Use external editor", so you just build with it, but no longer edit with it. Good editor examples & descriptions (I added detailed descriptions for these editors): 1. Eclipse 2. Sublime Text 3
After merging this PR, I could use some help from you getting clang-format running on your Windows machine so you can document the process in the main readme. I've written it up already but am not on a Windows machine to test, so I did some guessing and online searching a bit. By the way, using github to review code can be challenging. I highly recommend using |
Yep windows version works with that installation instruction, you can update the readme, I approved the PR |
Now that @nimrod46 has tested the instructions and says they work, I can remove the part saying the instructions were untested and I needed help to test them.
Added clang-format to auto-format the code, and ran it on the main Arduino .ino file.
To run the formatter, simply do this from the command line (see main README for both
Windows and Linux installation instructions):
This should be done before all PRs are merged forever and onward into the future, as a standard practice by the person making the PR before we will merge the PR.
Fixes #21