-
Notifications
You must be signed in to change notification settings - Fork 50
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 file #151
base: master
Are you sure you want to change the base?
Conversation
Don't ever do this. |
@chfast ? |
You can fix it, but reformatting all the code will never be accepted. You should propose .clang-format config first. I recommend the one from ethminer. |
Sorry I closed it prematurely. |
ah ok. will roll back then. This format file is from cpp-ethereum |
About fixing it: clang-format reorders the includes (if asked). This can be the reason for build errors. |
Apparently this was not the issue, as I had tried earlier to simply switch around the only two includes. |
I'm really for it. It can be different style, but it would make my life easier if I could reformat my changes with a single click. |
What style would you prefer? |
Alright, I am using the ethminer clang-format file. I have no preference for the style outside of plain C. |
I do not really like formatting changes like this:
The second one is way harder to follow. Is there a way to keep the former one? |
I am all for having this merged, but couldn't so far find a config fulfilling all my requirements :) |
Seems like the webkit style is the closest: https://webkit.org/code-style-guidelines/ Need to check these out:
|
If you want to experiment with it,
. You will be able to see all available options. |
Yeah I am reading the documentation and have a pretty good version now. |
I don't think there is any option to change how the expressions are packed. If you want hand-crafted expressions, wrap them with |
Can I use it for new code? |
13c17d2
to
0b0535c
Compare
Rebased. |
Codecov Report
@@ Coverage Diff @@
## master #151 +/- ##
==========================================
+ Coverage 50.89% 52.02% +1.12%
==========================================
Files 8 8
Lines 1342 1311 -31
Branches 130 129 -1
==========================================
- Hits 683 682 -1
+ Misses 632 602 -30
Partials 27 27 |
a7cb8c6
to
eed78fb
Compare
@chfast please note I'll adjust the settings, just wanted to push CI first. |
I've noticed you touched this PR, so I dumped the style I'm currently using for Hera. I don't care which one is used in the end, but having one is big improvement for my daily workflow. |
What's the progress? |
6965e7d
to
54505a8
Compare
@chfast pushed some updates which are a bit closer to the current and Solidity's style. What do you think? I still can't get over how ugly it formats |
I will take a look next week. I've notices clang-format has problems with formatting arrays of lambdas. You don't want to format CMake files... |
Yeah the final version of this PR won't do that. |
Should copy the rules from https://github.com/wasmx/fizzy. |
Fixes #150