GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fedebenelli/fordoctest: Assure standarized Fortran documentation with tests!

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs/media
docs/media
 
 
fordoctest
fordoctest
 
 
test
test
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 
requirements_dev.txt
requirements_dev.txt
 
 

Repository files navigation

fordoctest

CI Python Fortran Coverage

Assure Fortran documentation consistency.

fordoctest uses FORD to parse a Fortran project and reports entities that are missing documentation. It is the Fortran counterpart of tools such as pydoctest.

Installation

pip install fordoctest

For development:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements_dev.txt

Usage

fordoctest <ford_project_file> [ford_flags]
fordoctest <fpm.toml or fpm project directory>

Examples:

fordoctest doc/doc.md
fordoctest fpm.toml
fordoctest --max-modules 2 doc/doc.md
fordoctest --check-imperative doc/doc.md
fordoctest --color always doc/doc.md

FORD options such as -d, -m, --exclude and --config are forwarded to FORD when a markdown project file is used. Run fordoctest --help for the fordoctest-specific options.

Output is colourised automatically when the terminal supports it. Use --color always or --color never to force it, or set NO_COLOR to disable colour in auto mode.

Exit codes

Code Meaning
0 All checks passed
1 At least one documentation issue was found
2 The project could not be loaded or the arguments were invalid

Issues are written to standard error, one per line.

Project configuration

For a FORD markdown project file, use the usual FORD metadata block:

project: My project
src_dir: src
preprocess: false

For an fpm project, FORD settings can be placed in the [extra.ford] table of fpm.toml. Without that table, fordoctest checks the standard fpm source directories (src, app, test, example, examples and benchmark).

Tool-specific options can be stored in [extra.fordoctest]. The historical spelling [extra.fordoxtest] is accepted as an alias:

[extra.fordoctest]
max_modules = 2
check_imperative = true
color = "auto"  # auto, always or never

Command-line flags take precedence over these values. Unknown keys are rejected so a typo cannot silently disable a check.

Checks

By default fordoctest reports:

  • More than one module per source file (--max-modules changes the limit).
  • Undocumented modules, submodules and programs.
  • Undocumented file-level, module and program procedures.
  • Undocumented procedure arguments.
  • Undocumented derived types, type components and type-bound procedures.
  • Undocumented interfaces.

Pass --check-imperative to additionally flag procedure documentation whose first word is a clear third-person or non-imperative form (for example "Computes..." instead of "Compute..."). This check is a conservative heuristic and is disabled by default.

Doxygen comments

FORD's Doxygen support is used directly: !> block comments (the predocmark setting) are read as documentation, @param fills in argument documentation and a @brief-only comment still counts as documentation. Trailing !< comments are not supported by FORD, so document arguments with @param instead.

Example output:

example output

Limitations

  • fordoctest depends on FORD's parser and project model.
  • The imperative-verb check only uses a small English word list.
  • Module-level variables and local variables inside procedures are not checked.
  • There is no automatic documentation fixer.

Development

black --check .
pytest --cov=fordoctest --cov-report=term-missing --cov-fail-under=90
python -m build
twine check dist/*

The test suite uses temporary FORD projects and does not require a Fortran compiler because preprocessing is disabled in the fixtures.

Beta checklist

  • Check the main Fortran entity kinds, including derived types, interfaces and submodules.
  • Include optional documentation restrictions (imperative verbs).
  • Test suite with at least 90% coverage.
  • Become independent of FORD's CLI parser (not planned for 0.1).

License

Mozilla Public License 2.0. See LICENSE.

About

Assure standarized Fortran documentation with tests!

Topics

documentationdocumentation-toolfordfortranpython

Resources

Readme
MPL-2.0 license
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.