Skip to content

refactor: replace diagram doctests with directives and add pre-commit hook#590

Merged
fgmacedo merged 1 commit intodevelopfrom
refactor/diagram-docs-cleanup
Mar 3, 2026
Merged

refactor: replace diagram doctests with directives and add pre-commit hook#590
fgmacedo merged 1 commit intodevelopfrom
refactor/diagram-docs-cleanup

Conversation

@fgmacedo
Copy link
Owner

@fgmacedo fgmacedo commented Mar 3, 2026

Summary

  • Replace inline doctests in docs/diagram.md and README.md with plain Python code blocks and statemachine-diagram Sphinx directives — removes side-effect image generation from tests/docs
  • Add generate-images pre-commit hook that regenerates the README traffic light PNG via the existing CLI (python -m statemachine.contrib.diagram), triggered only when diagram source or the example machine change
  • Remove TestReadmeImageGeneration test class (replaced by the hook)
  • Delete 4 obsolete PNG images no longer referenced by any doc page
  • Update docs/releases/1.0.1.md to use the Sphinx directive instead of a static image reference

… hook

- Replace inline doctests in docs/diagram.md and README.md with plain
  python code blocks and statemachine-diagram Sphinx directives
- Add generate-images pre-commit hook to regenerate README PNG via CLI
- Remove TestReadmeImageGeneration (side-effect replaced by hook)
- Delete obsolete PNG images no longer referenced by docs
- Update release notes to use directive instead of static image
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4953985) to head (9b92826).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop      #590   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        38           
  Lines         4555      4555           
  Branches       724       724           
=========================================
  Hits          4555      4555           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fgmacedo fgmacedo merged commit 966500d into develop Mar 3, 2026
14 checks passed
@fgmacedo fgmacedo deleted the refactor/diagram-docs-cleanup branch March 3, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant