scaffold
Manage project boilerplate via bundled scaffold templates.
Synopsis
fobis scaffold <action> [options]Actions
| Action | Description |
|---|---|
status | Show drift report: OK, OUTDATED, or MISSING for each managed file |
sync | Update divergent files (shows diff + asks confirmation, or --yes to auto-accept) |
init | Create all missing boilerplate in a new or existing repo |
list | List all managed template files and their categories |
Options
Common options
| Option | Description |
|---|---|
-f, --fobos | Path to fobos configuration file (default: fobos) |
status options
| Option | Description |
|---|---|
--files <glob> | Limit scope to files matching this glob pattern |
--strict | Exit non-zero if any drift is detected (for CI use) |
sync options
| Option | Description |
|---|---|
--dry-run | Show what would change without writing any files |
-y, --yes | Apply all changes without interactive prompts |
--files <glob> | Limit scope to files matching this glob pattern |
init options
| Option | Description |
|---|---|
-y, --yes | Skip 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.ymlscripts/release.shscripts/run_tests.shscripts/install.shscripts/compute-coverage.shdocs/package.jsoncliff.tomlCONTRIBUTING.mdLICENSE.gpl3.md
Templated files have placeholders substituted with project metadata before comparison:
.github/workflows/release.ymldocs/.vitepress/config.mtsdocs/ford.mdfpm.toml
Variable resolution
Each template variable is resolved in a fixed priority order:
| Variable | fobos [project] key | Fallback |
|---|---|---|
| name | repository slug, then '' |
| summary | '' |
| repository | git remote get-url origin |
| (derived) | last path segment of — never stored in fobos |
| website | '' |
| authors (newline-separated → joined with ', ') | git config user.name |
| email | git config user.email |
| year | current 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.
| Variable | Example 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
fobis scaffold statusOutput:
OK .github/workflows/docs.yml
OUTDATED .github/actions/setup-build-env/action.yml
MISSING scripts/release.sh
...Preview what sync would change (no writes)
fobis scaffold sync --dry-runSync a single file without prompting
fobis scaffold sync --files "cliff.toml" --yesBootstrap a new Fortran project
mkdir MyProject && cd MyProject
git init
fobis scaffold initPrompts for any missing project variables, creates directory structure (src/, docs/, .github/, scripts/), and writes all managed files.
CI drift check
fobis scaffold status --strictExits 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:
[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 Smithauthors 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.