fprettier

Crates.iofprettier
lib.rsfprettier
version0.2.0
created_at2026-01-17 21:55:35.897736+00
updated_at2026-01-24 03:57:24.462372+00
descriptionAuto-formatter for modern Fortran source code
homepage
repositoryhttps://github.com/fredjones42/fprettier
max_upload_size
id2051260
size608,968
(fredjones42)

documentation

README

fprettier

fprettier is an auto-formatter for Fortran 90+ code.

fprettier is inspired by fprettify but strives to be:

  • :zap: Fast, especially for large codebases
  • :wrench: Actively maintained, with prompt responses to issues

Installation

First, install Rust and Cargo by following the instructions at:

https://rustup.rs

Then install fprettier:

cargo install fprettier

Usage

Run fprettier with no arguments to display the usage information.

Revision History

Version 0.2.0

New Features:

  • Added support for C preprocessor directives (#if, #ifdef, #endif, etc.) -- preprocessor lines are preserved without formatting and indentation is handled correctly within preprocessor blocks

Bug Fixes:

  • Fixed alignment in the presence of statement labels
  • Fixed FORMAT statement continuation alignment
  • Fixed leading +/- on continuation lines being incorrectly treated as binary operators instead of unary
  • Fixed spacing around .NOT. operator
  • Fixed spacing of SELECT TYPE/CASE statements
  • Fixed indentation of one-line do/end do constructs
  • Fixed OpenMP (!$OMP) continuation line handling
  • Fixed spacing after comma before concatenation operator (//)
  • Fixed indentation with pre-ampersand continuation style
  • Fixed END IF recognition after semicolon on same line
  • Various other whitespace and spacing improvements

Version 0.1.0

  • Initial release with core formatting capabilities:
    • Indentation normalization
    • Keyword case conversion
    • Whitespace normalization around operators
    • Line continuation handling
    • Alignment of trailing comments and inline assignments
    • TOML configuration file support
    • In-file directive overrides (! fprettier:)
    • Parallel processing via Rayon for large codebases
    • Fypp preprocessor directive support
Commit count: 30

cargo fmt