Skip to main content

ffmt

PyPI CI License: MIT GitHub Marketplace Docs

A fast, configurable Fortran formatter with support for Fypp, Doxygen, and OpenACC/OpenMP directives. Written in Rust. Installable via pip.

Documentation | Configuration | Changelog

Installation

pip install ffmt

Or via Cargo:

cargo install ffmt

Quick start

ffmt src/                        # format in-place
ffmt --check src/                # CI mode (exit 1 if changes needed)
ffmt --diff src/                 # show colored diff
ffmt -j 8 src/                   # parallel
cat file.fpp | ffmt -            # stdin/stdout

Features

  • Code -- indentation, whitespace normalization, keyword casing, named ends, line wrapping, operator modernization (.eq. -> ==), double-colon enforcement, trailing semicolon removal
  • Comments -- rewrapping, inline spacing (S102), !< alignment, !&/& ! cleanup, format suppression (! ffmt off/on)
  • Structure -- blank line management around openers/closers/#ifdef, declaration :: alignment, declaration/use compaction
  • Preprocessor -- Fypp (#:if, $:, @:), C preprocessor (#ifdef), OpenACC (!$acc), OpenMP (!$omp)
  • Opt-in -- multi-statement splitting, assignment alignment, & column alignment, use-statement reformatting

Most options accept true, false, or "preserve". See the configuration reference for all options.

Configuration

Create ffmt.toml or add [tool.ffmt] to pyproject.toml:

indent-width = 4
line-length = 132
keyword-case = "lower"
modernize-operators = true
enforce-double-colon = true

[whitespace]
relational = true
multdiv = false

CI

# GitHub Actions
- uses: sbryngelson/ffmt@latest
  with:
    args: "--check src/"
# pre-commit
repos:
  - repo: https://github.com/sbryngelson/ffmt
    rev: v0.4.3
    hooks:
      - id: ffmt

Other Fortran formatters

Formatter Language Status Notes
fprettify Python Unmaintained Free-form only. Fypp support.
findent C Active Indentation and fixed/free conversion.
Codee Formatter Proprietary Active Commercial. Tree-sitter based.
LFortran fmt Rust In development AST-based.
Fortitude Rust Active Linter with auto-fix.

License

MIT

Download files

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

Source Distribution

ffmt-0.4.4.tar.gz (108.8 kB view details)

Uploaded Source

Built Distributions

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

ffmt-0.4.4-py3-none-win_amd64.whl (1.5 MB view details)

Uploaded Python 3Windows x86-64

ffmt-0.4.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ffmt-0.4.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

ffmt-0.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ffmt-0.4.4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (3.3 MB view details)

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

File details

Details for the file ffmt-0.4.4.tar.gz.

File metadata

  • Download URL: ffmt-0.4.4.tar.gz
  • Upload date:
  • Size: 108.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ffmt-0.4.4.tar.gz
Algorithm Hash digest
SHA256 80c834dd3874881de282059000f58fb80ca9062f72d63bb14927701f675ba1e9
MD5 c985acdd6b1802f159069afe066428d6
BLAKE2b-256 d11b35eefefb1364fbb38587e631f261ba87f1a92d8513f30e19511cc846cfe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ffmt-0.4.4.tar.gz:

Publisher: release.yml on sbryngelson/ffmt

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

File details

Details for the file ffmt-0.4.4-py3-none-win_amd64.whl.

File metadata

  • Download URL: ffmt-0.4.4-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ffmt-0.4.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7d4e2abdf9ae276a0ec417f8b91e0f8bea27061814e889ac641104ffeca64b81
MD5 d791c36038fe2d644824c74e30572503
BLAKE2b-256 d868fcf4ed65e83043ac8f1ac144e750dd30dd987ff10e20c6781d33203699d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ffmt-0.4.4-py3-none-win_amd64.whl:

Publisher: release.yml on sbryngelson/ffmt

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

File details

Details for the file ffmt-0.4.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ffmt-0.4.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7e40ff6144fc21a9764ee0b17a97145870d631c826b8deb39b9e16ded2ffb8e
MD5 ad6e984728ddd53f24ba11f3e56938e1
BLAKE2b-256 960ffa92728fab7d6464b3cd3f31a9071dfb2f04cbaae2c305042794237155a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ffmt-0.4.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on sbryngelson/ffmt

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

File details

Details for the file ffmt-0.4.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for ffmt-0.4.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f1cb73cc657d897bd7d21a786f38de077a570cdf7e0969b135fa65827eede3e2
MD5 f7a8ff19268204f970bbd056dc050832
BLAKE2b-256 6ab550bc603afb51844f141d6f03512f0cfd4a8da21428da21ab2de981b3ad6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ffmt-0.4.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: release.yml on sbryngelson/ffmt

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

File details

Details for the file ffmt-0.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ffmt-0.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 521746d6f80d5d9fa31525cb53ee129b67ba18919a8e06875cb84f15b5de55b7
MD5 c87c7abaed8603ddd7aa72d90e70dbbc
BLAKE2b-256 163684b26942560992747788a3be76b7211dcc7c7d023d3634e59e392e648732

See more details on using hashes here.

Provenance

The following attestation bundles were made for ffmt-0.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on sbryngelson/ffmt

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

File details

Details for the file ffmt-0.4.4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for ffmt-0.4.4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 452433c2b07aa1abe080535e0a5b3246479b2ff68f345525decd6cf847572220
MD5 5fb32533e7c40c89aef6383dca30bcb3
BLAKE2b-256 4a32b7bdf9c7b05f87d75cb92592960fe7e75ffa7ccdfc6407b1f6d7e24d29c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ffmt-0.4.4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on sbryngelson/ffmt

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 Pingdom Monitoring Sentry Error logging StatusPage Status page