-
Notifications
You must be signed in to change notification settings - Fork 214
Patch patch command #3714
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
base: dev
Are you sure you want to change the base?
Patch patch command #3714
Conversation
) | ||
) | ||
files = list(files) | ||
log.info(files) |
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.
make it a warning or remove
choices=[ | ||
questionary.Choice("Abort diff creation", "a"), | ||
questionary.Choice("Ignore file", "i"), | ||
questionary.Choice("Warn in diff", "w"), |
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 don't think we need to offer the option to warn, if we can't read the file, I would say either we abort and let the user remove it, or ignore the file.
Co-authored-by: Júlia Mir Pedrol <mirp.julia@gmail.com>
This PR addresses the issue raised in #3708. It does this by catching the
UnicodeDecodeError
and prompting the user for an action. This way, the user can more easily see if the undecoded file should be there or not. The user then has the option to include the warning in the diff, if the file should be ignored or if the diff creation should be aborted altogether.To not prompt several times I've added an ignore list as an attribute to the
print_diff
andwrite_diff
functions. This is updated when a an erronenous file is found. If passed to the next function (seepatch.py
) the ignore list is used instead of prompting the user.A better solution is likely to convert the
ComponentsDiffer
class from a static to a normal class. Then the ignore list, and other things could be attributes of the class instead.I've also updated the output from the
patch
command which showed the diff several times. Now it prints a panel with all changes instead of printing some with the logger.PR checklist
CHANGELOG.md
is updateddocs
is updated