Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

show diff only when --diff #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

misho104
Copy link

The current behavior of pyformat is different from autopep8, which returns diff only when --diff option is specified and otherwise returns the whole file content.
It would be nice if the behavior of pyformat, which currently returns diff always, could be the same as autopep8, because then users can use pyformat just by replacing their autopep8 to pyformat.

For example, this issue of vscode is solved and vscode users can use pyformat with a simple modification of their configuration.

@coveralls
Copy link

coveralls commented Jan 25, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 5d21b07 on misho104:diff_option into 7293e4d on myint:master.

Options for autopep8 should be better configured in project-configuration files
@myint
Copy link
Owner

myint commented Jan 27, 2019

Thanks! To preserve backward compatibility, let's make an option to print out the whole file. Leave the current behavior as the default. Note that the diff-by-default behavior matches some other other tools (autoflake, unify, etc.).

Also, I don't think it should allow printing out the whole file if there are multiple files being checked. This would risk someone accidentally concatenating multiple files into a single file.

@misho104
Copy link
Author

misho104 commented Feb 2, 2019

Fair enough, and i agree on it! I'll try to do such when I have spare time.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants