Skip to main content

forformat

forformat formats free-form Fortran source files. It provides findent-compatible indentation, plus an optional full-format mode for selected lexical normalization and wrapping.

The package installs the forformat command. It requires Python 3.9 or newer and does not provide an importable Python formatting API.

Install

python -m pip install forformat

Use

Format one or more Fortran files in place:

forformat src/module.f90
forformat src/*.f90

Use standard input and output in a pipeline:

forformat --stdin < src/module.f90 > /tmp/module.f90
forformat --stdout src/module.f90 > /tmp/module.f90

Use --check in CI to fail when files need formatting, or --diff to print unified diffs:

forformat --check src/*.f90
forformat --diff src/*.f90

Project context

When you pass explicit paths, forformat scans the current Git checkout for free-form Fortran sources and uses declarations from those files to resolve names while formatting. Only the paths you pass are changed. This project-aware behavior is useful when a declaration in one module controls the spelling or formatting of code in another file.

For independent file processing, use --isolated with explicit paths:

forformat --isolated src/module.f90
forformat --isolated --stdout src/module.f90 > /tmp/module.f90

Input from standard input is also processed without a repository scan:

forformat --stdin < src/module.f90 > /tmp/module.f90

Example profile

This profile mirrors the indentation settings used by CAMB. The final --indent-contains=restart setting is intentional; options may be written with hyphens or underscores.

forformat \
	--full \
	--indent=4 \
	--indent-module=0 \
	--indent-procedure=0 \
	--start-indent=4 \
	--indent-contains=0 \
	--openmp=0 \
	--indent-contains=restart \
	--indent-select=4 \
	--indent-case=4 \
	--indent-interface=0 \
	--indent-continuation=4 \
	--indent-ampersand \
	src/*.f90

The default is --full. Use --indent-only for findent-compatible indentation and trailing whitespace handling. Run forformat --help for all options. Fixed-form Fortran and automatic format detection are not supported.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

forformat-0.1.0-py3-none-win_amd64.whl (360.5 kB view details)

Uploaded Python 3Windows x86-64

forformat-0.1.0-py3-none-manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl (498.6 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64musllinux: musl 1.2+ x86-64

forformat-0.1.0-py3-none-manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl (463.0 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64musllinux: musl 1.2+ ARM64

forformat-0.1.0-py3-none-macosx_11_0_arm64.whl (495.8 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

forformat-0.1.0-py3-none-macosx_10_12_x86_64.whl (535.1 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

forformat-0.1.0-py3-none-macosx_10_9_universal2.whl (416.9 kB view details)

Uploaded Python 3macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file forformat-0.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: forformat-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 360.5 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for forformat-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 78c0f4c7b20ffba39d7e71ea1fa852938394e565c597df989b98a46fbf1aca75
MD5 d8cacd93d899b1f1eb97c132ef3c0f1c
BLAKE2b-256 ab9105b17685f72f8d93818efea61ac108207811b70b9e340175acb6f009444f

See more details on using hashes here.

Provenance

The following attestation bundles were made for forformat-0.1.0-py3-none-win_amd64.whl:

Publisher: pypi.yml on cmbant/forformat

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

File details

Details for the file forformat-0.1.0-py3-none-manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for forformat-0.1.0-py3-none-manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8c39e8e93a787e2734d1e85bc0ccb4b38e1345265fddabc6b83304f3bfd4b73a
MD5 34aa0f545a0a1f142500a1a70568c3e7
BLAKE2b-256 e5ad1d38cc00eeed43591d0b7dd63d3fbfb32d2543c6743d4223af21993f1480

See more details on using hashes here.

Provenance

The following attestation bundles were made for forformat-0.1.0-py3-none-manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl:

Publisher: pypi.yml on cmbant/forformat

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

File details

Details for the file forformat-0.1.0-py3-none-manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for forformat-0.1.0-py3-none-manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 87957a362a65cfc5e67d5f4fa82f998f4b7a3309522d485c4c49b63da32b0628
MD5 4270fc9bbc0da7958a14858287fbaa5d
BLAKE2b-256 b4fb8fff22cb644ee7b488f980d9dcc409539d709c95621426378ea318e10b9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for forformat-0.1.0-py3-none-manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl:

Publisher: pypi.yml on cmbant/forformat

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

File details

Details for the file forformat-0.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for forformat-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e46d54532901b22af742f9b619879d57028961999e9854a7403b1fb49d408184
MD5 c2900ead133e25362eb9cd92cb528f1f
BLAKE2b-256 1c4150e62227602f13a28be3c1b5bf18404648d1269bdeb9a37356303c0ffd8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for forformat-0.1.0-py3-none-macosx_11_0_arm64.whl:

Publisher: pypi.yml on cmbant/forformat

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

File details

Details for the file forformat-0.1.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for forformat-0.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c9ea2f0236384a617f8e8c23b87d8c61687658989705d4458726546bc8cb2aa3
MD5 d07a87dd8f08c7484a44830358dbc6fc
BLAKE2b-256 8376f023e37a7787174b8dcae2a0fd0f419daa682291e79296502c262ac37887

See more details on using hashes here.

Provenance

The following attestation bundles were made for forformat-0.1.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: pypi.yml on cmbant/forformat

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

File details

Details for the file forformat-0.1.0-py3-none-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for forformat-0.1.0-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 75d9cb1520912f595661b64795a6fd9241caff7f1dfd7a40850a7fb659c4b0d5
MD5 201b7f3b3e0fd1aa2b85d107112fe2fd
BLAKE2b-256 b8baef3abd93ff2df4d3d1257f4ac635d341d4c89e948500da15141e34693270

See more details on using hashes here.

Provenance

The following attestation bundles were made for forformat-0.1.0-py3-none-macosx_10_9_universal2.whl:

Publisher: pypi.yml on cmbant/forformat

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

Supported by

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