nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
10.08k stars 1.31k forks source link

Update template code to match formatting tool. #2840

Closed timcanham closed 2 weeks ago

timcanham commented 2 months ago
F´ Version v3.4.3
Affected Component n/a

Feature Description

Update the generated code to match the C++ formatter tool.

Rationale

When we start editing the impl files or looking at the AC files, it doesn't match the supported formatter. For impl code, we have to run the formatter to "clean up" the code. This makes diffing against the generated impl code harder if we add new FPP and re-run the impl generator.

thomas-bc commented 2 months ago

FYI this is already implemented in fprime-util impl (here), the command calls fpp-to-cpp and formats the files that are generated. However we have noticed inconsistencies in how clang-format locates and handles the .clang-format style file based on versions of clang-format. We should lock down on a version (or range thereof) of clang-format and recommend that for development.

thomas-bc commented 2 months ago

See discussion on https://github.com/nasa/fprime-tools/pull/199 for more details

thomas-bc commented 2 weeks ago

I am going to close this as it is now implemented and released in v3.5.0. fprime-bootstrap project creates a .clang-format file at the root of the project, and fprime-util impl uses that to format any file that it generates