forked from scala-steward-org/scala-steward
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor pull request head: replace conditionals with polymorphism
This is another example of replacing conditionals with polymorphism on `ForgeType`. This was a theme in commit b42866b, merged in this PR back in August 2023: scala-steward-org#3145 A benefit of this pattern is as new types of forge are implemented, the responsibilities for supporting that new `ForgeType` are all in one place, rather than spread across several methods elsewhere in the codebase. To confess, I think there's probably a further refactor that could be done, to introduce a better parameter object denoting a 'Pull Request Head' (that conceivably could better model the way that some `ForgeType`s don't even support forking) - but that can wait for another day, fixing scala-steward-org#3300 is more urgent!
- Loading branch information
Showing
4 changed files
with
30 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
modules/core/src/main/scala/org/scalasteward/core/forge/package.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters