[robotpy] Run wpiformat on non-python robotpy files (#8362)

This turns the styleguide on for the non-python robotpy files.

The overwhelming amount of changes were
related to whitespace, followed by some IWYU for standard library
headers.
This commit is contained in:
PJ Reiniger
2026-06-21 22:36:03 -04:00
committed by GitHub
parent 6bc7051e23
commit 4a2cd3e5d0
71 changed files with 877 additions and 739 deletions

View File

@@ -1,20 +1,19 @@
#include <semiwrap_init.halsim_gui._ext._halsim_gui_ext.hpp>
#include <functional>
#include <wpi/halsim/gui/HALSimGuiExt.hpp>
#include <wpi/hal/Extensions.h>
#include <wpi/halsim/gui/HALSimGuiExt.hpp>
#include "semiwrap_init.halsim_gui._ext._halsim_gui_ext.hpp"
std::function<void()> g_gui_exit;
SEMIWRAP_PYBIND11_MODULE(m) {
initWrapper(m);
m.def("_kill_on_signal", []() {
HAL_RegisterExtensionListener(
nullptr, [](void *, const char *name, void *data) {
nullptr, [](void*, const char* name, void* data) {
std::string_view name_view{name};
if (name_view == HALSIMGUI_EXT_GUIEXIT) {
g_gui_exit = (halsimgui::GuiExitFn)data;
@@ -23,14 +22,14 @@ SEMIWRAP_PYBIND11_MODULE(m) {
AddGuiLateExecute([] {
py::gil_scoped_acquire gil;
if (PyErr_CheckSignals() == -1) {
// If a python signal has been triggered, the GUI needs to exit. It's
// not safe to throw an exception here on all platforms so we just
// assume that the only eventual caller of this function is HAL_RunMain,
// and our wrapper around that function will check if a python error is
// set and throw from there.
// If a python signal has been triggered, the GUI needs to exit.
// It's not safe to throw an exception here on all platforms so
// we just assume that the only eventual caller of this function
// is HAL_RunMain, and our wrapper around that function will
// check if a python error is set and throw from there.
//
// Reference: https://github.com/wpilibsuite/allwpilib/issues/8528
// Reference:
// https://github.com/wpilibsuite/allwpilib/issues/8528
if (g_gui_exit) {
g_gui_exit();
} else {
@@ -41,4 +40,4 @@ SEMIWRAP_PYBIND11_MODULE(m) {
}
});
});
}
}