Skip to content

FPP Formatting - #5630

Open
Kronos3 wants to merge 9 commits into
nasa:develfrom
Kronos3:fpp-format
Open

Kronos3 wants to merge 9 commits into
nasa:develfrom
Kronos3:fpp-format

Conversation

@Kronos3

@Kronos3 Kronos3 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator
Related Issue(s) Depends on nasa/fprime-tools#336, nasa/fpp#1062, fprime-community/fpp-tools#32
Has Unit Tests (y/n) n
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) y

Change Description

This PR integrates a new fpp-format tool / fprime-util format FPP formatting. The formatting tool is a concrete-syntax-tree (CST) based formater meaning it does not remove information like comments or "intentional" newlines. While the formatter is a novel strategy, it is heavily reliant on the Red/Green tree parsing strategy employed by rust-analyzer. Read more about this here.

The formatter tries to stay true to the stylistic choices of .fpp files across our F Prime projects:

  1. 4-space indentation
  2. Single blank line delimiters of line groups
  3. Breaking of long lines using \ continuation and multi-line lists
  4. Alignment of @< post annotations on consecutive lines (two spaces before)
  5. Alignment of = on consecutive lines (in enums/constant defs)
  6. Alignment of -> on consecutive lines (in connection graphs)
  7. Keeps blank lines after { and before } if provided

Rationale

We have been relying on manual formatting of FPP files.

Testing/Review Recommendations

These rules are defined upfront but I may have missed/misrepresented some. It would be good to get input from our maintainers/community on desired canonical FPP formatting style.

Future Work

N/A

AI Usage (see policy)

Claude Opus 4.8 was used for hooking with the CI/updating some of our tools. The CST parser was written manually. Formatting rules were given to claude and it iterated on heuristics to match this style.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Coverage report — base devel

Overall (line): 83.30% → 83.28% (-0.02)
Regression threshold: 0.50% (line).

Regressions

Module Line Δ Function Δ Branch Δ
Drv/Udp 72.92 -2.08 90.91 +0.00 57.14 -9.53

Modules changed

Module Line Δ Function Δ Branch Δ
Drv/Udp 72.92 -2.08 90.91 +0.00 57.14 -9.53
Os/Generic/Types 92.14 -0.36 92.86 +0.00 73.83 -1.87
Fw/DataStructures 97.87 -0.17 97.14 +0.00 82.48 -0.37
Os/Generic 90.34 +0.20 89.13 +0.00 75.86 +1.53

New modules

Module Line Function Branch
Fw/Prm 0.00 0.00 0.00

Modules without UTs

CFDP/Checksum/GTest, Drv/LinuxGpioDriver, Drv/LinuxI2cDriver, Drv/LinuxSpiDriver, Drv/LinuxUartDriver, Drv/Ports/DataTypes, FppTestProject/FppTest/topology/async, FppTestProject/FppTest/topology/components/Comp, FppTestProject/FppTest/topology/components/Framework, FppTestProject/FppTest/topology/components/Receiver, FppTestProject/FppTest/topology/components/Sender, FppTestProject/FppTest/topology/guarded, FppTestProject/FppTest/topology/sync, FppTestProject/FppTest/topology/top_ports, FppTestProject/FppTest/topology/types, Fw/Com, Fw/Comp, Fw/FilePacket/GTest, Fw/Fpy, Fw/Obj, Fw/Port, Fw/Sm, Fw/Test, Fw/Types/GTest, Os/Models, Svc/Ccsds/Types, Svc/FatalHandler, Svc/Subtopologies/CdhCore, Svc/Subtopologies/ComCcsds, Svc/Subtopologies/ComCcsdsSdls, Svc/Subtopologies/ComFprime, Svc/Subtopologies/ComLoggerTee, Svc/Subtopologies/DataProducts, Svc/Subtopologies/DpCompression, Svc/Subtopologies/FileHandling, Svc/Subtopologies/FileHandlingCfdp, Svc/Subtopologies/FileHandlingCfdp/FileHandlingCfdpConfig, TestDeploymentsProject/Ref/DpDemo, TestDeploymentsProject/Ref/PingReceiver, TestDeploymentsProject/Ref/RecvBuffApp, TestDeploymentsProject/Ref/SendBuffApp, TestDeploymentsProject/Ref/Top, TestDeploymentsProject/Ref/TypeDemo, cmake/test/data/TestConfigDeployment, cmake/test/data/TestDeployment/TestBuildAutocoder, cmake/test/data/TestDeployment/TestHeaderAutocoder, cmake/test/data/TestDeployment/TestLinkDepends, cmake/test/data/TestDeployment/TestRelative, cmake/test/data/test-fprime-library/TestLibrary/TestComponent, cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent

@Kronos3 Kronos3 added blocked FPP Tandem PR needs an FPP release to be merged labels Aug 11, 2026
@LeStarch LeStarch added the Deferred To Future Release This PR is marked as deferred until after the upcoming release. label Aug 12, 2026
# Conflicts:
#	FppTestProject/FppTest/topology/async/async.fpp
#	FppTestProject/FppTest/topology/guarded/guarded.fpp
#	FppTestProject/FppTest/topology/special_ports/topology.fpp
#	FppTestProject/FppTest/topology/sync/sync.fpp
#	Os/Models/Task.fpp
#	Svc/Ccsds/CfdpManager/Events.fppi
#	Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.fpp
#	Svc/DpCompressProc/DpCompressProc.fpp
#	Svc/FileDispatcher/FileDispatcher.fpp
#	Svc/FileManager/Commands.fppi
#	Svc/FileManager/Events.fppi
#	Svc/FileManager/FileManager.fpp
#	Svc/FprimeFramer/FprimeFramer.fpp
#	Svc/Subtopologies/CdhCore/CdhCore.fpp
#	Svc/Subtopologies/CdhCore/CdhCoreConfig/CdhCoreConfig.fpp
#	Svc/Subtopologies/CdhCore/CdhCoreConfig/CdhCoreTlmConfig.fpp
#	Svc/Subtopologies/ComCcsds/ComCcsds.fpp
#	Svc/Subtopologies/ComCcsds/ComCcsdsConfig/ComCcsdsConfig.fpp
#	Svc/Subtopologies/ComFprime/ComFprime.fpp
#	Svc/Subtopologies/ComFprime/ComFprimeConfig/ComFprimeConfig.fpp
#	Svc/Subtopologies/ComLoggerTee/ComLoggerTeeConfig/ComLoggerTeeConfig.fpp
#	Svc/Subtopologies/ComLoggerTee/subtopology-template.fppi
#	Svc/Subtopologies/DataProducts/DataProducts.fpp
#	Svc/Subtopologies/DataProducts/DataProductsConfig/DataProductsConfig.fpp
#	Svc/Subtopologies/FileHandling/FileHandling.fpp
#	Svc/Subtopologies/FileHandling/FileHandlingConfig/FileHandlingConfig.fpp
#	Svc/Subtopologies/FileHandlingCfdp/FileHandlingCfdp.fpp
#	Svc/Subtopologies/FileHandlingCfdp/FileHandlingCfdpConfig/FileHandlingCfdpConfig.fpp
#	Svc/TlmChan/TlmChan.fpp
#	Svc/TlmPacketizer/TlmPacketizer.fpp
#	TestDeploymentsProject/Ref/Top/topology.fpp
#	default/config/ComCfg.fpp
#	requirements.txt

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Deferred To Future Release This PR is marked as deferred until after the upcoming release. FPP Tandem PR needs an FPP release to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants