fluff is an experimental Fortran linter and formatter built on the
FortFront AST and semantic APIs.
The project is useful as a FortFront-based tool prototype, but it is not yet a Ruff-equivalent production tool. Several CLI and formatter features are still tracked as open issues.
Implemented or partially implemented:
- style rules
F001toF015 - performance rules
P001toP007 - correctness rule
C001 - formatter built on FortFront
emit_fortran - basic LSP components
- JSON/SARIF/GitHub-style output code paths
Known limits:
- configuration support has open regressions
- formatter can still move inline comments in unsafe ways
- rule selection/ignore CLI parity with Ruff is incomplete
- stdin, quiet mode, statistics, rule listing, and show-fixes UX are tracked as open issues
- AST caching is disabled in the linter path because FortFront arena/context copies are not yet safe enough
git clone git@github.com:lazy-fortran/fluff.git
cd fluff
fpm build --profile releasefluff check src/
fluff format src/
fluff check --output-format json src/Use fluff --help for the options supported by the current build.
fluff should not parse Fortran text itself. The intended flow is:
- read source
- parse with FortFront tooling APIs
- run FortFront semantic analysis
- execute AST-based lint rules
- format through FortFront code emission plus local cleanup passes
This keeps parser and semantic behavior aligned with FortFront and avoids regex-based language analysis.
See ROADMAP.md and the open issues. The short version:
- fix formatter safety first
- finish CLI parity needed for daily use
- repair configuration loading
- only then improve cache/LSP polish
- fortfront: parser, AST, semantic analysis, formatter emission.
- standard: target language-mode behavior for LFortran Standard and Infer.
MIT. See LICENSE.