Skip to content

feat: add --events option to diagram CLI#593

Merged
fgmacedo merged 2 commits intodevelopfrom
feat/diagram-cli-events
Mar 8, 2026
Merged

feat: add --events option to diagram CLI#593
fgmacedo merged 2 commits intodevelopfrom
feat/diagram-cli-events

Conversation

@fgmacedo
Copy link
Owner

@fgmacedo fgmacedo commented Mar 8, 2026

Summary

  • Add --events option to python -m statemachine.contrib.diagram CLI to instantiate the machine and send events before rendering, highlighting the current active state
  • Update pre-commit hook to pass --events cycle cycle cycle so the README TrafficLightMachine diagram shows the green state as active
  • Update diagram docs and 3.1.0 release notes

The diagram CLI now supports `--events event1 event2 ...` to instantiate
the machine and send events before rendering, matching the Sphinx
directive's `:events:` option. The pre-commit hook uses this to generate
the README diagram with the green state active.
@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##           develop      #593   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           39        39           
  Lines         4591      4597    +6     
  Branches       732       734    +2     
=========================================
+ Hits          4591      4597    +6     
Flag Coverage Δ
unittests 100.00% <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.

The YAML `>-` folding inserted a space in the `files:` regex, preventing
the hook from matching `statemachine/contrib/diagram/` paths. Use a
single-line string instead. Regenerate the README diagram with the green
state highlighted.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2026

@fgmacedo fgmacedo merged commit 19556ce into develop Mar 8, 2026
14 checks passed
@fgmacedo fgmacedo deleted the feat/diagram-cli-events branch March 8, 2026 02:40
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