Repository navigation
refactor: keyword-only booleans on the applications functions - #535
Merged
gaborbernat merged 1 commit intoAug 27, 2026
Merged
Conversation
user_applications_dir and user_applications_path took no arguments in 4.11.4, so the ensure_exists and use_site_for_root that tox-dev#534 gave them have never shipped and nothing can be passing them positionally. Making them keyword-only there is free, and drops the FBT suppressions that only existed because they were positional. Released signatures are untouched. site_applications_dir keeps multipath and ensure_exists positional as it has had them since 4.9.0.
gaborbernat
force-pushed
the
refactor/keyword-only-booleans
branch
from
August 27, 2026 21:12
368640e to
626e873
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the question on #531 about the FBT suppressions. They are only needed because the booleans are positional, which is the thing the rule objects to, and a
*fixes the finding rather than silencing it.Scoped to arguments that have never shipped, so nothing breaks.
user_applications_diranduser_applications_pathtook no arguments in 4.11.4; theensure_existsanduse_site_for_rootthat #534 gave them are still unreleased, so no caller can be passing them positionally. Making them keyword-only now costs nothing and removes the four suppressions.Released signatures are untouched.
site_applications_dirandsite_applications_pathkeepmultipathandensure_existspositional, as they have been since 4.9.0, and their suppressions stay. I checked every public function in__init__.pyagainst the 4.11.4 tag: no released parameter changes name, position or kind.I first wrote this as a sweep over all 55 functions and
PlatformDirs, which would have taken the suppressions from 88 down to 17. That is not worth breaking every caller who passes a boolean positionally, so it is out. If you ever cut a major, the diff is easy to reproduce.appname,appauthorandversionstay positional throughout. A test pins the new shape so it does not quietly regress.Testing:
tox -e fix,-e type,-e docsclean, full suite passes. The fourtest_comp_with_appdirs[site_data_dir-*]failures reproduce on a cleanorigin/mainworktree from a localXDG_DATA_DIRS.