A fast, configurable Fortran formatter with Fypp, Doxygen, and OpenACC/OpenMP support
Project description
ffmt
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.2.8
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ffmt-0.3.0.tar.gz.
File metadata
- Download URL: ffmt-0.3.0.tar.gz
- Upload date:
- Size: 78.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d99857a29803948edff796d3a221b6686036ae51b02ba8094992bf65d39ad840
|
|
| MD5 |
54ca3d0e5fd83c26c3c740765965d07a
|
|
| BLAKE2b-256 |
d9f13dc541c16334e7fd806b16129293d042214aa71314b729ada8f251c5832c
|
Provenance
The following attestation bundles were made for ffmt-0.3.0.tar.gz:
Publisher:
release.yml on sbryngelson/ffmt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ffmt-0.3.0.tar.gz -
Subject digest:
d99857a29803948edff796d3a221b6686036ae51b02ba8094992bf65d39ad840 - Sigstore transparency entry: 1166871541
- Sigstore integration time:
-
Permalink:
sbryngelson/ffmt@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sbryngelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Trigger Event:
release
-
Statement type:
File details
Details for the file ffmt-0.3.0-py3-none-win_amd64.whl.
File metadata
- Download URL: ffmt-0.3.0-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.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2834bb3952952630598eef5561db5bfabaf34bd8ea67ae7d9b2d29167e4ad09f
|
|
| MD5 |
59829bbe7171030d836a72c9a68b08e2
|
|
| BLAKE2b-256 |
1401aa0ec20058121269755ab9233ba81ef80da467db3c9378ffcab8abc6efd5
|
Provenance
The following attestation bundles were made for ffmt-0.3.0-py3-none-win_amd64.whl:
Publisher:
release.yml on sbryngelson/ffmt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ffmt-0.3.0-py3-none-win_amd64.whl -
Subject digest:
2834bb3952952630598eef5561db5bfabaf34bd8ea67ae7d9b2d29167e4ad09f - Sigstore transparency entry: 1166871599
- Sigstore integration time:
-
Permalink:
sbryngelson/ffmt@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sbryngelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Trigger Event:
release
-
Statement type:
File details
Details for the file ffmt-0.3.0-py3-none-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: ffmt-0.3.0-py3-none-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aef4d375ebc7fd504b64b0e929136ef9cf505cea4e4d7045307e031588e6f4e1
|
|
| MD5 |
e988ba5cf94e33e4e4572404e630dd5b
|
|
| BLAKE2b-256 |
a9fee5bee893654f04db96741180cf87f4242be61a6a7be2532721d604934682
|
Provenance
The following attestation bundles were made for ffmt-0.3.0-py3-none-manylinux_2_34_x86_64.whl:
Publisher:
release.yml on sbryngelson/ffmt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ffmt-0.3.0-py3-none-manylinux_2_34_x86_64.whl -
Subject digest:
aef4d375ebc7fd504b64b0e929136ef9cf505cea4e4d7045307e031588e6f4e1 - Sigstore transparency entry: 1166871663
- Sigstore integration time:
-
Permalink:
sbryngelson/ffmt@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sbryngelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Trigger Event:
release
-
Statement type:
File details
Details for the file ffmt-0.3.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: ffmt-0.3.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8d054c6989f5ee9811d64e966f38029cf4c843fbddd491f355718822a12f637
|
|
| MD5 |
e751f9e07e0dd1bad9f6ff1180ef1b88
|
|
| BLAKE2b-256 |
88d022fed65b16e418639ad2fe2f09c6b109b7eb7c12c8d6a9b8fdf62a6890cc
|
Provenance
The following attestation bundles were made for ffmt-0.3.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on sbryngelson/ffmt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ffmt-0.3.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
c8d054c6989f5ee9811d64e966f38029cf4c843fbddd491f355718822a12f637 - Sigstore transparency entry: 1166871745
- Sigstore integration time:
-
Permalink:
sbryngelson/ffmt@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sbryngelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@baa95b9115ec2ff2bb980c741ae23cc60aec241b -
Trigger Event:
release
-
Statement type: