Skip to content

Conversation

@willnet
Copy link
Member

@willnet willnet commented Nov 11, 2025

Changed the approach so constants can be safely loaded even when a configured submodule doesn’t exist, without raising a NameError

Changed the approach so constants can be safely loaded even when a configured submodule doesn’t exist, without raising a NameError
@willnet willnet requested a review from Copilot November 11, 2025 22:51
Copilot finished reviewing on behalf of willnet November 11, 2025 22:53
Copy link
Contributor

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

This PR refactors the submodule loading mechanism in lib/sorcery/controller.rb to use a more explicit constant checking approach instead of relying on exception handling for missing submodules.

Key changes:

  • Replaced try-catch exception handling with a proactive const_defined? check before attempting to load submodules
  • Extracted the submodule name transformation into a separate variable for improved readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willnet willnet requested a review from a team November 13, 2025 00:53
Right now, Submodules doesn’t inherit anything, but to prevent unintended includes if Submodules is changed in the future, I explicitly made sure that constants from Submodules’ ancestors are not included.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@joshbuker joshbuker merged commit b057fe8 into Sorcery:master Nov 14, 2025
14 checks passed
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