Add --checkup mode to check user configuration#1509
Add --checkup mode to check user configuration#1509rolandwalker wants to merge 1 commit intomainfrom
--checkup mode to check user configuration#1509Conversation
ad6d66c to
7dc6f45
Compare
This helps the user who has upgraded see which new features are silently being set to the package defaults.
7dc6f45 to
3fd95b0
Compare
| if section_name not in mycli.config_without_package_defaults: | ||
| if not did_output: | ||
| print('\nMissing in user ~/.myclirc:\n') | ||
| print(f'The entire section:\n\n [{section_name}]\n') |
There was a problem hiding this comment.
Due to:
Line 145 in 3fd95b0
This won't ever fire for the [main] or [connection] sections (will just output every option in the section). Likely wouldn't happen for [main] when upgrading, but possible for [connection] since that is newer. Not a big deal, but wanted to point it out in case it matters.
| def do_config_checkup(mycli: MyCli) -> None: | ||
| did_output = False | ||
| for section_name in mycli.config.keys(): | ||
| if section_name not in mycli.config_without_package_defaults: |
There was a problem hiding this comment.
If no user .myclirc exists, it will output every option as missing. Similar vein to the below comment that this may not matter for an upgrade situation, but might be worth adding a check to do nothing if no file exists.
scottnemes
left a comment
There was a problem hiding this comment.
Verified overall functionality works as expected. Tested by removing an option as well as entire sections, and it output as expected.
Approving as-is, but see comments in case you want to change anything.
Description
This helps the user who has upgraded see which new features are silently being set to the package defaults.
Checklist
changelog.mdfile.AUTHORSfile (or it's already there).