EAMxx clang-format
Workflow
#7307
Replies: 5 comments 14 replies
-
+1 on 2 spaces. We have a few places with plenty of nesting levels, so keeping indentation small helps (I often have two terminals open, side-to-side). 2 spaces is the bare minimum that my eye can recognize. |
Beta Was this translation helpful? Give feedback.
-
I prefer we remain as close as possible to defaults. I am interested in gathering what other projects do. Creating a list here:
|
Beta Was this translation helpful? Give feedback.
-
Side convo: what's the consensus on how the formatting should happen? I see two main options:
|
Beta Was this translation helpful? Give feedback.
-
@mjschmidt271 what do you think about this? We make the clang format action produce a nicely formatted patch and make that available as an artifact uploaded in the action? manually, this could be achieved with something like:
you can test if it's working properly by
To be clear, the goal: people can download the format.diff file and just apply it to their code locally if they don't want to run clang-format locally |
Beta Was this translation helpful? Give feedback.
-
Do you know what format setting makes this change? - EKAT_REQUIRE_MSG (n_a==ncols_fine or n_b==ncols_fine,
- "Error! The input map seems incompatible with the remapper fine grid.\n"
- " - map file: " + map_file + "\n"
- " - map file n_a: " + std::to_string(n_a) + "\n"
- " - map file n_b: " + std::to_string(n_b) + "\n"
- " - fine grid ncols: " + std::to_string(ncols_fine) + "\n");
+ EKAT_REQUIRE_MSG(n_a == ncols_fine or n_b == ncols_fine,
+ "Error! The input map seems incompatible with the remapper fine grid.\n"
+ " - map file: " +
+ map_file +
+ "\n"
+ " - map file n_a: " +
+ std::to_string(n_a) +
+ "\n"
+ " - map file n_b: " +
+ std::to_string(n_b) +
+ "\n"
+ " - fine grid ncols: " +
+ std::to_string(ncols_fine) + "\n"); I personally find the latter unreadable (besides using more than 2x as many lines), so I would vote for disabling this "formatting" option. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This page is intended to be for discussion or comments on formatting decisions related to the clang-format styling choices.
Topics
3-tab Indentation
Beta Was this translation helpful? Give feedback.
All reactions