-
Notifications
You must be signed in to change notification settings - Fork 395
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
Fix clang format not working in CI #2790
base: master
Are you sure you want to change the base?
Conversation
@@ -48,20 +48,19 @@ void check_netlist(int verbosity) { | |||
/* Check that nets fanout and have a driver. */ | |||
int global_to_non_global_connection_count = 0; | |||
for (auto net_id : cluster_ctx.clb_nlist.nets()) { | |||
h_net_ptr = insert_in_hash_table(net_hash_table, cluster_ctx.clb_nlist.net_name(net_id).c_str(), size_t(net_id)); | |||
h_net_ptr | |||
= insert_in_hash_table(net_hash_table, cluster_ctx.clb_nlist.net_name(net_id).c_str(), size_t(net_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BreakBeforeBinaryOperators: All
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugly. Prefer the BreakBeforeBinaryOperators: NonAssignment to keep the = on the first line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am indifferent on this one. My personal preference for this line would be:
h_net_ptr = insert_in_hash_table(net_hash_table,
cluster_ctx.clb_nlist.net_name(...),
...)
Or the line above should use more temporary variables to make this look nicer (which is good practice on the programmer's part).
enum e_gain_update { GAIN, NO_GAIN }; | ||
enum e_feasibility { FEASIBLE, INFEASIBLE }; | ||
enum e_gain_type { HILL_CLIMBING, NOT_HILL_CLIMBING }; | ||
enum e_removal_policy { REMOVE_CLUSTERED, LEAVE_CLUSTERED }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add AllowShortEnumsOnASingleLine: false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong preference from me on this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also indifferent on this one. I actually think its nice; but I do understand if we want consistency.
I changed ColumnLimit from 0 (unlimited) to 120. I suggest a few other changes in
|
Adding @AlexandreSinger and @duck2 in case they want to weigh in. |
Can merge when we get agreement on these few questions ... thanks for driving this! |
Hi @soheilshahrouz , thank you so much for fixing this! I cannot believe the problem was just a submodule issue. I worry that this PR will trample all PRs currently in flight (it will cause conflicts with all code); but I think it is so worth it. I was looking at how it reformatted my AP code (because my coding style is perfect 😁) and beyond the if statement to one line thing (which I mentioned above as bad), I agree with most of the changes. I do have a couple of comments:
Sorry for the long response, I am very passionate about this! |
Don't let my message above discourage you Soheil though, I really really really like this change and am excited to get this merged in! I like it when code is consistent throughout the entire repo! |
I think 80 characters is too wrenching; we have a lot of long variable names (which I generally like), and made the decision long ago to abandon 80 characters (partially pushed by Google actually, so I don't think 80 characters is a universal rule there). I think if we went to 80 characters it would be a big make work project. I think anything controversial should be run by the Thursday meeting too, and an 80 character limit would be in that category in my opinion. |
@vaughnbetz Understood! I do agree this is something to bring up in the weekly meeting; however, this should not block this PR from getting merged in. As you say, the code is already quite wide, so reducing it now will be just as complicated as reducing it later. Push come to shove you can change small portions of the clang style in sub-projects (but I do not think the fact that I "want it to be 80" is enough argument to not follow the VTR style guide). |
Solves issue 2667