Uh oh!
There was an error while loading. Please reload this page.
Prep-work for clang-format. - #3078
Conversation
* Inserting clang-format using the same docker container as used for clang-tidy (silkeh/clang:12). * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). * Manually moving `// NOLINT` and `// NOLINTNEXTLINE` comments so that clang-format does not move them to the wrong places. * Manually reformatting comments related to `static_assert`s so that clang-format does not need two passes. * git diff -U0 --no-color HEAD^ | python3 $HOME/clone/llvm-project/clang/tools/clang-format/clang-format-diff.py -p1 -style=file -i
… the order and thereby confusing MSVC 2015.
…r the just-merged PR pybind#3080. Also rerunning clang-format-diff.py to pick up a few fixes missed before.
98e451b to
eb0a55bCompare| function will throw a `cast_error` exception. When the Python function | ||
| call fails, a `error_already_set` exception is thrown. | ||
| \endrst */ | ||
| // clang-format on |
There was a problem hiding this comment.
Wouldn't disabling reflow_comments be better? Or there may be some of there might be some way to get it to recognize \rst \endrst as off and on clang-format comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rwgk
commented
Jul 12, 2021
This one I will basically have to do from scratch after #3087 is done. At that point the only remaining clang-format related question should be how to deal with the |
rwgk
commented
Jul 15, 2021
This PR is obsolete. The only step left to do on top of the merged #3087 is somehow dealing with the |
Prep-work for global clang-format (see experimental/demo PRs #3074, #3082).
NO bulk changes in this PR, just minimal changes such that a global clang-format is stable after a single pass.
This was several hours of tedious work running clang-format & clang-tidy until both are stable. Breaking out as a separate PR so that these manual changes do not have to be maintained separately while we decide how to integrate clang-format or clang-format-diff into the pre-commit hooks.
Notable steps:
Systematically adding
// clang-format off,onaround all\rst\endrstblocks. — Possibly some could be omitted, but for blocks that are deliberately formatted as\rstit is safer to systematically exclude them from clang-format. Note that the sphinx error messages are often completely useless if something goes wrong, therefore letting clang-format loose on\rstblocks is likely to turn into time-consuming surprises.Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh).
Manually moving clang-tidy
// NOLINTand// NOLINTNEXTLINEcomments so that clang-format does not move them to the wrong places. (This was the most tedious part.)Manually reformatting comments related to
static_asserts so that clang-format does not need two passes.git diff -U0 --no-color HEAD^ | python3 $HOME/clone/llvm-project/clang/tools/clang-format/clang-format-diff.py -p1 -style=file -iSuggested changelog entry: