Skip to content

STY: Use the FfBits enum instead of a plain integer for form field flags - #4003

Merged
stefan6419846 merged 2 commits into
py-pdf:mainfrom
RavSinghChandan:flags-accepts-int
Aug 25, 2026
Merged

stefan6419846 merged 2 commits into
py-pdf:mainfrom
RavSinghChandan:flags-accepts-int

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

update_page_form_field_values takes its flags as FieldDictionaryAttributes.FfBits and the docstring points readers at that enum, but the tests passed a bare 1 in five places.

FfBits(1) is ReadOnly, so spelling it out says what the call is actually asking for rather than leaving the reader to look up the bit.

Same shape as #3997

update_page_form_field_values takes its flags as FieldDictionaryAttributes
FfBits, and the docstring points readers at that enum, but the tests passed a
bare 1 in five places. FfBits(1) is ReadOnly, so spelling it out says what the
call is asking for.

Same shape as py-pdf#3997.
@codecov

codecov Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.98%. Comparing base (08e6f6b) to head (31de95c).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4003   +/-   ##
=======================================
  Coverage   97.98%   97.98%           
=======================================
  Files          57       57           
  Lines       11106    11106           
  Branches     2080     2080           
=======================================
  Hits        10882    10882           
  Misses        125      125           
  Partials       99       99           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/test_writer.py Resolved
The surrounding test modules import constants unabbreviated, and the lines
still fit within the configured limit.
@RavSinghChandan

Copy link
Copy Markdown
Contributor Author

Fair enough, spelled it out. The lines are longer but still inside the 120 character limit, and it matches how the other test modules import constants.

@stefan6419846 stefan6419846 changed the title DOC: Use the FfBits enum instead of a plain integer for form field flags STY: Use the FfBits enum instead of a plain integer for form field flags Aug 25, 2026
@stefan6419846
stefan6419846 merged commit 2d21458 into py-pdf:main Aug 25, 2026
44 of 49 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