src/: Fortran library sources (e.g.,backends/,figures/,utilities/).test/: FPM tests (test_*.f90). Generated test artifacts default tobuild/test/output/(Issue #820 viasrc/testing/fortplot_test_helpers.f90).example/: Fortran examples; generated media inoutput/example/....cmake/,Makefile,fpm.toml: Build systems; docs indoc/, FORD config indoc.md.
- Build (FPM):
make buildorfpm build. - Run examples:
make example. - Debug apps:
make debugorfpm run --target <app>. - Tests:
make testorfpm test; CI-fast set:make test-ci. - Docs:
make doc(FORD →build/doc/index.html). - Clean:
make clean. Examples:make test ARGS="--target test_public_api",make example ARGS="basic_plots".
- Fortran: free-form, no implicit typing (
fpm.tomlenforces), preferuse fortplot, only: wp => real64. - Indentation: spaces, keep modules under ~1000 lines; group by subfolders (
backends/,figures/). - Names: tests
test_*.f90; procedures snake_case; modules end with_tfor derived types (e.g.,figure_t). - Tooling: pre-commit for whitespace/EOF/YAML/TOML checks (
.pre-commit-config.yaml).
- Framework: FPM auto-discovers tests in
test/. Name new teststest_<topic>.f90and keep output inbuild/test/output/. - Run subsets:
fpm test --target <name>. - Env controls:
FORTPLOT_SUPPRESS_WARNINGS=1 make test(quiet),FORTPLOT_FORCE_WARNINGS=1 make test.
- Required for any change affecting plots, ticks, labels, or backends.
- Run:
make verify-artifacts(runs key examples and strict PDF/PNG/text checks). - Evidence in PRs: include the exact commands run, artifact paths, and short excerpts from
pdftotext/.txt(e.g.,x³ - 50xvisible; no malformed labels like01000+03). - Do not close rendering issues or merge PRs without passing
make verify-artifactsand attaching evidence.
- Commits: Conventional Commits style (
feat:,fix:,docs:,refactor:,cleanup:). Example:fix: resolve pcolormesh dimension validation (#600). - PRs: concise description, link issues, list user-facing changes, include before/after images for rendering changes, and note test targets run (e.g.,
test-ci) plusmake verify-artifactsoutput snippets.
- Animations require
ffmpeg(optional). Verify withffprobeif needed. - Hardened builds: trampoline checks via
fpm build --flag "-Wtrampolines -Werror=trampolines". - Verification:
make verify-functionality,make verify-size-compliancefor artifact integrity.