Skip to content

scaffold

Manage project boilerplate via bundled scaffold templates.

Synopsis

bash
fobis scaffold <action> [options]

Actions

ActionDescription
statusShow drift report: OK, OUTDATED, or MISSING for each managed file
syncUpdate divergent files (shows diff + asks confirmation, or --yes to auto-accept)
initCreate all missing boilerplate in a new or existing repo
listList all managed template files and their categories

Options

Common options

OptionDescription
-f, --fobosPath to fobos configuration file (default: fobos)

status options

OptionDescription
--files <glob>Limit scope to files matching this glob pattern
--strictExit non-zero if any drift is detected (for CI use)

sync options

OptionDescription
--dry-runShow what would change without writing any files
-y, --yesApply all changes without interactive prompts
--files <glob>Limit scope to files matching this glob pattern

init options

OptionDescription
-y, --yesSkip interactive confirmation prompts

Description

fobis scaffold automates creation and maintenance of project boilerplate across Fortran repositories. All templates are bundled inside FoBiS.py — no external dependencies required.

Template categories

Verbatim files are copied as-is; drift is detected via SHA-256 comparison against the bundled canonical version:

  • .github/workflows/ci.yml
  • .github/workflows/docs.yml
  • .github/actions/setup-build-env/action.yml
  • .github/actions/run-coverage-analysis/action.yml
  • scripts/release.sh
  • scripts/run_tests.sh
  • scripts/install.sh
  • scripts/compute-coverage.sh
  • docs/package.json
  • cliff.toml
  • CONTRIBUTING.md
  • LICENSE.gpl3.md

Templated files have placeholders substituted with project metadata before comparison:

  • .github/workflows/release.yml
  • docs/.vitepress/config.mts
  • docs/ford.md
  • fpm.toml

Variable resolution

Each template variable is resolved in a fixed priority order:

Variablefobos [project] keyFallback
namerepository slug, then ''
summary''
repositorygit remote get-url origin
(derived)last path segment of — never stored in fobos
website''
authors (newline-separated → joined with ', ')git config user.name
emailgit config user.email
yearcurrent calendar year

AUTHORS format note: fobos stores authors one-per-line (configparser continuation syntax). Scaffold joins them with ', ' for template substitution. When fobis scaffold init prompts for AUTHORS, enter authors comma-separated (e.g. Jane Doe, John Smith).

YEAR note: set year = 2020 in [project] to fix the copyright year across all generated files; omit it to always use the current year.

VariableExample value
PENF
Portability Environment for Numerical Framework
https://github.com/szaghi/PENF
PENF
https://szaghi.github.io/PENF
Stefano Zaghi, Jane Doe
stefano.zaghi@gmail.com
2020

Examples

Check drift across all managed files

bash
fobis scaffold status

Output:

  OK       .github/workflows/docs.yml
  OUTDATED .github/actions/setup-build-env/action.yml
  MISSING  scripts/release.sh
  ...

Preview what sync would change (no writes)

bash
fobis scaffold sync --dry-run

Sync a single file without prompting

bash
fobis scaffold sync --files "cliff.toml" --yes

Bootstrap a new Fortran project

bash
mkdir MyProject && cd MyProject
git init
fobis scaffold init

Prompts for any missing project variables, creates directory structure (src/, docs/, .github/, scripts/), and writes all managed files.

CI drift check

bash
fobis scaffold status --strict

Exits with code 1 if any file is outdated or missing — suitable for a CI step that enforces boilerplate consistency.

fobos integration

Scaffold reads project metadata from the [project] section of your fobos file:

ini
[project]
name       = MyProject
summary    = A short description
repository = https://github.com/jane/MyProject
website    = https://jane.github.io/MyProject
email      = jane@example.com
year       = 2020
authors    = Jane Doe
             John Smith

authors is newline-separated (configparser continuation); scaffold joins them with ', ' for template substitution. year is optional — omit it to use the current calendar year.

See Project Metadata for full details.