Skip to content

Conversation

@louisscruz
Copy link

In some cases, one might aim to use madge to get a list of circular dependencies without necessarily exiting 1 in the case that some are found. This PR adds an --allow-circular flag that will allow for that.

@louisscruz
Copy link
Author

@pahen would you consider adding this? Or, perhaps some variation of this?

@PabloLION
Copy link
Collaborator

@PabloLION
Copy link
Collaborator

Hi, @louisscruz , thanks for this handy idea. I'm here to help with the PR.
Apart from the aforementioned problems, it seems to me the word "allow" is a bit of vague in the sense of "who allows what": madge won't forbid user to have circular dependency, it only throws error on checking.
Maybe we can consider using word like suppress or ignore?

@PabloLION
Copy link
Collaborator

Due to the inactivity, I'm going to do the edit myself and add some output test.

@PabloLION PabloLION requested a review from Copilot September 25, 2025 04:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new --allow-circular flag to madge that allows the script to exit with code 0 even when circular dependencies are found, providing users the ability to list circular dependencies without triggering a failure exit code.

  • Introduces --allow-circular flag for non-failing circular dependency detection
  • Updates documentation to clarify exit behavior with and without the flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@PabloLION PabloLION self-requested a review September 25, 2025 04:28
@PabloLION PabloLION dismissed their stale review September 25, 2025 04:28

reviewed with copilot

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.

2 participants