-
Notifications
You must be signed in to change notification settings - Fork 259
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
Override heading style with supplied cell style #979
Conversation
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.
I'm not sure how to go about writing a test for this change, or even if its necessary given the small scope.
Yes, you want a test for this. It's really quite simple: Create an example that applies a style to the heading row and another one to an individual header cell within it. In the old version the cell style would get overwritten by the general header style. In the new version either the cell style will take precedence or they will get merged (see above). That will demonstrate the changed behaviour of the new code, and catch any regressions that might happen in the future.
Also, you want to describe the new behaviour in "docs/Tables.md".
af2e37e
to
7aa4e40
Compare
I believe I've responded to your comments. I had some trouble running some of the tests, likely because I'm working on an m1 mac. For example my new test fails because the object ID and creation date fail, but I see that those are supposed to be removed from diffs. Because I took your suggestion to add a combine function for FontFace, I added a test for that function. And I made the test for heading styling override a bit more complex to demonstrate combinations of override features. |
Have you used |
No, I didn't notice the |
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.
Nice work. Solid and clean implementation, clear documentation, and useful test case.
Can't even find any details to nitpick over... 😉
You'll just have to rebase and resolve the conflict in the changelog, and then it can be merged.
8431831
to
ba92f32
Compare
Thanks, I've fixed the issue with the test pdf, and resolved the changelog conflict. Should be all set. |
Did you run the complete test suite locally? |
e7c534d
to
41f3056
Compare
Sorry about that, it's fixed now. It was relying for its behavior on the heading styles not being overridden by supplied cell styles. |
I see it failed in
Is there something I should do on my end? |
The shared images test has some timing checks built in, which may fail randomly. But there are also some real issues: Please run pylint and black on the fpdf and test directories before committing, and fix anything they might complain about. |
Add combine method to FontFace in fonts.py, allowing for partial overrides
41f3056
to
2a9736c
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #979 +/- ##
==========================================
- Coverage 93.79% 93.75% -0.04%
==========================================
Files 28 28
Lines 8396 8410 +14
Branches 1545 1549 +4
==========================================
+ Hits 7875 7885 +10
- Misses 323 325 +2
- Partials 198 200 +2
☔ View full report in Codecov by Sentry. |
Finally there. Thanks for your first code contribution, @TedBrookings ! |
Thanks for bearing with me while I got up to speed! |
@allcontributors please add @TedBrookings for code |
I've put up a pull request to add @TedBrookings! 🎉 |
What changes are being made? (What feature/bug is being fixed here?) -->
Fixes #956. When cell style is explicitly provided for a header line, use the cell style instead of the header style.
Checklist:
The GitHub pipeline is OK (green),
meaning that both
pylint
(static code analyzer) andblack
(code formatter) are happy with the changes of this PR.A unit test is covering the code added / modified by this PR
This PR is ready to be merged
In case of a new feature, docstrings have been added, with also some documentation in the
docs/
folderA mention of the change is present in
CHANGELOG.md
I'm not sure how to go about writing a test for this change, or even if its necessary given the small scope.