Skip to content

Conversation

@jechol
Copy link
Contributor

@jechol jechol commented May 7, 2025

This pull request fixes the behavior of the --min-cycle-size option in mix xref graph --format cycles.

Previously, cycles with a size equal to the specified minimum were excluded.
For example, running mix xref graph --format cycles --min-cycle-size 2 would only include cycles of size >= 3, which is unintuitive and inconsistent with the option name.

This change updates the behavior to be inclusive, so that --min-cycle-size 2 includes all cycles of size >= 2, as expected.

Fixes: #14474

Updates cycle filtering logic to include cycles matching the minimum size.
Improves test cases to ensure accurate handling of `min_cycle_size` scenarios.
@jechol jechol changed the title Make --min-cycle-size in mix xref graph inclusive (fixes #14474) Make --min-cycle-size in mix xref graph inclusive May 7, 2025
@josevalim josevalim merged commit 3c3637c into elixir-lang:main May 7, 2025
11 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@jechol jechol deleted the mix-xref-min-cycle-size branch May 7, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

mix xref --min-cycle-size filters cycles exclusively (> instead of >=)

2 participants