-
Notifications
You must be signed in to change notification settings - Fork 0
Improve class structure #27
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
Conversation
This creates a bit of repetation but will help to create a base class that doesn't depend on a class from black
The goal is to separate black related logic from rest of the code
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 567 579 +12
Branches 30 31 +1
=========================================
+ Hits 567 579 +12 ☔ View full report in Codecov by Sentry. |
b5bc0a6 to
da309d8
Compare
There was a problem hiding this 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 class structure of the formatters module by introducing a base class abstraction and changing how BlackFormatter is initialized.
Key Changes:
- Introduced
BaseProcessorbase class that extracts common formatting logic fromBlackFormatter - Changed
BlackFormatterAPI from accepting aModeparameter to accepting individual formatting options - Updated all test cases to use the new parameterless
Formatter()constructor instead ofFormatter(mode=BLACK_MODE)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/ruffen_docs/formatters.py | Introduces BaseProcessor base class with abstract process_code_block method and refactors BlackFormatter to extend it, accepting individual Mode parameters instead of a Mode object |
| src/ruffen_docs/init.py | Removes direct black import and updates BlackFormatter instantiation to pass formatter options as keyword arguments instead of creating a Mode object |
| tests/test_ruffen_docs.py | Updates all 60+ test cases to instantiate Formatter without the mode parameter, relying on default values |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
da309d8 to
a43dab6
Compare
a43dab6 to
6fcc325
Compare
Supersedes #23