-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring the way formatters are loaded to make easy to include custom formatter #451
Comments
@emilio2hd please let me know if you want me to make a release for the above tools to depend on -- I'd be eager to try it at $WORK as well 😁 |
emilio2hd
changed the title
Refator the way formatters are loaded to make easy to include custom formatter
Refactoring the way formatters are loaded to make easy to include custom formatter
Oct 27, 2023
Hey @ashkulz yahoo! Let's do it! |
@emilio2hd pronto 0.11.2 released to RubyGems 🎉 |
@emilio2hd I'm looking forward to you updating |
@ashkulz Done! released latest version removing the monkey patch 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
I was talking with a friend once about how pronto can create a huge noise adding too many comments on github, when a PR is big.
By the time, we're discussing how other tool was nice posting the comments as github annotation leaving the comments just for developers.
So, I've thought how it would be nice if pronto could do the same thing.
Workaround
Investigating the code, I noticed that the json formatter wouldn't be enough. I ended up creating this (not yet released) gem pronto-annotations_formatter, which produces a json to be consumed by pronto-annotate-action.
I wasn't happy because I had to do some Monkeypatch stuff to modify the
Pronto::Formatter::FORMATTERS
, which I think it's really dangerous, but it was the only way I could think.One could argue "you could've just used a rake task". Well, yeah but I want to shared this solution because more people could benefit from it, and I think nothing is better than a Gem to share this.
Refactoring
After analysing the code again, I thought on how Devise loads its strategies. The same pattern could be applied to formatter.
I branched out the repo and implemented the pattern.
Please check the PR #450.
Now, with this solution I don't need to use Monkeypatch in my Gem, I just need to do:
The text was updated successfully, but these errors were encountered: