Skip to main content

fprime-fpp-format

A formatter for the F Prime Prime (FPP) modeling language.

This package ships the fpp-format executable, a pretty-printer for .fpp source files.

Usage

# Format files in place
fpp-format path/to/model.fpp

# Check formatting without modifying (exit 1 if not formatted)
fpp-format --check path/to/model.fpp

# Format from stdin to stdout
cat path/to/model.fpp | fpp-format --stdin

# Override the indentation width and maximum line length
fpp-format --indent 4 --line-length 100 path/to/model.fpp

Options

Option Description
--check Check formatting without writing; exit 1 if a file is unformatted.
--stdin Read from stdin and write to stdout (default when no files given).
--recursive-includes Also follow include specifiers and format reachable .fppi fragments.
--indent <N> Number of spaces per indentation level. Overrides .fpp-format (default: 2).
--line-length <N> Maximum line width before specs explode their clauses. Overrides .fpp-format (default: 80).
--entry <RULE> Select the parser entrypoint / grammar rule (see below).
--help Print usage.

Configuration file (.fpp-format)

The indentation width and maximum line length can be set project-wide in a .fpp-format file. Starting from each formatted file's directory, fpp-format searches upward through parent directories for the nearest .fpp-format file (the same discovery model as .clang-format). The same file is honored by fprime-util format and by the language server's format-on-save, so the editor and CI always agree.

The file is a minimal key = value list; blank lines and # comments are ignored:

# .fpp-format
indent = 2
line-length = 80

Supported keys:

Key Description Default
indent Spaces per indentation level. 2
line-length Maximum line width before clauses break. 80

Precedence, lowest to highest: built-in defaults → .fpp-format file → --indent / --line-length command-line flags. A malformed .fpp-format file is a hard error on the command line (to avoid formatting with the wrong profile and reporting false --check failures); the language server logs it and falls back to defaults so an editor save never fails.

Entrypoint rule (--entry)

The formatter parses input starting from a specific grammar rule. A whole .fpp file is a module (the default), but other rules are needed when formatting include fragments.

Supported rules:

  • module (default)
  • component
  • topology
  • tlm-packet
  • tlm-packet-set

Recursive include formatting (--recursive-includes)

By default fpp-format formats only the files you name and does not touch .fppi fragments referenced via include. Pass --recursive-includes to also follow every include specifier and format the referenced fragments (recursively):

# Formats model.fpp and every .fppi it (transitively) includes
fpp-format --recursive-includes path/to/model.fpp

With --recursive-includes, include paths are resolved relative to the including file (matching the parser), each fragment is formatted exactly once even if included from several places, and include cycles are detected and reported as an error. The entrypoint for each fragment is derived from the context of its include — a fragment included in a component { ... } body is formatted as component members, one in a topology { ... } body as topology members, and so on, so you do not need --entry for fragments reached this way.

State-machine includes have no standalone entrypoint and are left untouched.

Note: the language-server integration never follows includes; it only ever formats the current document buffer.

Formatting a bare .fppi file

An .fppi file is not a standalone module — it is a fragment that is spliced in via an include specifier. When you format a fragment directly (rather than reaching it from a root .fpp), there is no include context to infer the rule from, so pass --entry to select the matching entrypoint:

# An .fppi included inside a `module { ... }` body (module-level members)
fpp-format --entry module commands.fppi

# An .fppi included inside a `component { ... }` body
fpp-format --entry component ports.fppi

# An .fppi included inside a `topology { ... }` body
fpp-format --entry topology connections.fppi

If you omit --entry, the module rule is used, which is correct for normal .fpp files and for .fppi fragments containing module-level members.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fprime_fpp_format-3.3.3.tar.gz (123.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fprime_fpp_format-3.3.3-py3-none-win_amd64.whl (418.5 kB view details)

Uploaded Python 3Windows x86-64

fprime_fpp_format-3.3.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (517.2 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

fprime_fpp_format-3.3.3-py3-none-macosx_11_0_arm64.whl (471.9 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file fprime_fpp_format-3.3.3.tar.gz.

File metadata

  • Download URL: fprime_fpp_format-3.3.3.tar.gz
  • Upload date:
  • Size: 123.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fprime_fpp_format-3.3.3.tar.gz
Algorithm Hash digest
SHA256 06988789abe5923b55a74c388cfc7c9e64b81ab8cad01d6331e05ab1f15441a1
MD5 ccf9fa6d5912d5f459eac97a57e26ca5
BLAKE2b-256 84e3e6a4dd5aa581cf3a53696d8cce2396eb8cb4fbdfe15b3136ecf4520f7f37

See more details on using hashes here.

Provenance

The following attestation bundles were made for fprime_fpp_format-3.3.3.tar.gz:

Publisher: pip.yml on fprime-community/fpp-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fprime_fpp_format-3.3.3-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for fprime_fpp_format-3.3.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6b0f7364c50eb277ed6121822b694302a78847764f0c0fcdc8db42d2234d238e
MD5 65797b2b6b995be0e11c3130a3c8e8a7
BLAKE2b-256 808812346808a976775c812fbbe8970eaf1eb034cf45b6a8b8415a133e7d76e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for fprime_fpp_format-3.3.3-py3-none-win_amd64.whl:

Publisher: pip.yml on fprime-community/fpp-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fprime_fpp_format-3.3.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fprime_fpp_format-3.3.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47aeebe002e9e9c9d805381c700b9fc73f82839d71926422c1a670e8f25675b9
MD5 180859e646ff1026dceb1300d14d8c7b
BLAKE2b-256 e4c41b369f30ce893f1f693c7e838b0f81f0506a5c5a4da7b03856cf0efc3fa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for fprime_fpp_format-3.3.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pip.yml on fprime-community/fpp-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fprime_fpp_format-3.3.3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fprime_fpp_format-3.3.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5714a485a7dff19061dbd16e6b55912b07b94ba1990651a7c3c535c700acb0be
MD5 25a91a59f2c4692d036bf44a06edc388
BLAKE2b-256 7e1f9b23959114451f61baea36b4351bd3d80d1de433850960418f865331ed6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fprime_fpp_format-3.3.3-py3-none-macosx_11_0_arm64.whl:

Publisher: pip.yml on fprime-community/fpp-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

3.3.10

4 files

3.3.9

4 files

3.3.8

4 files

3.3.7

4 files

3.3.6

4 files

3.3.5

4 files

3.3.4

4 files

This release

3.3.3 This release

4 files

3.3.2

4 files

3.3.1

4 files

3.3.0

4 files

3.0.0

4 files

2.3.1

4 files

2.3.0

4 files

2.2.1

4 files

2.2.0

4 files

2.1.0

4 files

2.0.2

4 files

2.0.1

4 files

2.0.0

4 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page