cpp: format part.hpp and bind_product_values.cpp with clang-format 18.1.8 (CI's clang-format job failed on them)

DECISION: only formatting, no behaviour change: re-wrap the header comment of part.hpp and the `bodies` property
definition in bind_product_values.cpp the way clang-format 18.1.8 writes them.

WHY: the CI job "clang-format" of the pull request for this series ("A Part holds exactly one solid") listed
exactly these two files ("needs formatting"). They were written by hand in the commit "part: a Part holds exactly
one solid" and the comment commit that followed, and the local build does not run clang-format (the project pins
18.1.8, installed here with `uv tool run --from clang-format==18.1.8 clang-format`). The reason for those edits is
unchanged (design-docs/part-holds-one-solid.md: a Part holds exactly one solid); this commit only makes them pass
the repository's format gate.

Checked: the eight C++ files the series touched are identical to clang-format 18.1.8's output (compared with
the CR characters removed). Note: running src/cpp/tools/check_format.sh with CLANG_FORMAT="uv tool run ..." reports
every file, because the script quotes the variable as one command name; use an installed clang-format instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Ni Jingzhe
2026-11-10 04:37:09 +08:00
parent 0a961d14ec
commit 695a03a04b
2 changed files with 7 additions and 6 deletions
@@ -477,8 +477,9 @@ void bind_part(py::module_& m) {
}),
py::arg("part_id"), py::arg("body"), py::arg("name") = py::none(), py::arg("material") = py::none(),
py::arg("connectors") = py::tuple())
.def_property_readonly("bodies", [](const Part& self) { return to_tuple(self.bodies()); },
"The Part's body as a one-element tuple (the Body carries the display appearance).")
.def_property_readonly(
"bodies", [](const Part& self) { return to_tuple(self.bodies()); },
"The Part's body as a one-element tuple (the Body carries the display appearance).")
.def("body_ids", [](const Part& self) { return to_tuple(self.body_ids()); })
.def(
"get_body", [](const Part& self, const py::object& id) { return self.get_body(text(id, "body_id")); },
+4 -4
View File
@@ -1,10 +1,10 @@
// A Part: one Solid (its body), with an optional material and its connector datums (product/part.py). Values are
// immutable: every `with_*` returns a new Part.
//
// A Part holds exactly one solid: it is the unit an assembly places, mates and gives connectors to. Several solids that
// exist side by side while a model is built (a tool and its target) are loose values of the notebook, and a deliverable
// of several solids is an Assembly of Parts. The body is kept as a `Body` only because it carries the display name,
// colour and opacity (`set_body_appearance_rpart`).
// A Part holds exactly one solid: it is the unit an assembly places, mates and gives connectors to. Several solids
// that exist side by side while a model is built (a tool and its target) are loose values of the notebook, and a
// deliverable of several solids is an Assembly of Parts. The body is kept as a `Body` only because it carries the
// display name, colour and opacity (`set_body_appearance_rpart`).
#pragma once
#include <memory>