Skip to content
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

Autoformat all Python in repo with autopep8 #70

Merged
merged 3 commits into from
Oct 15, 2018
Merged

Autoformat all Python in repo with autopep8 #70

merged 3 commits into from
Oct 15, 2018

Conversation

jasikpark
Copy link
Contributor

In #63, there was a request to write code only with tabs, to keep a consistent code style. I felt emboldened, and decided to autoformat the entire repo with autopep8, in order to have a very consistent code style across the project.

Is this a good and useful idea?

@jasikpark
Copy link
Contributor Author

jasikpark commented Oct 14, 2018

Two other options for formatting python code are Black and YAPF, though autopep8 is the more simple, popular formatter.

@jasikpark
Copy link
Contributor Author

Why is Codacy complaining that there's a function with shell=True when it was in the repo when I forked/cloned it?

@alichtman
Copy link
Owner

alichtman commented Oct 15, 2018

Why is Codacy complaining that there's a function with shell=True when it was in the repo when I forked/cloned it?

shell=True is an unsafe call when user input is being interpreted in the shell.

In reviewing this code now, I see a pretty glaring vulnerability that should be fixed. I do actually use raw user input at one place (asking for a path to backup to), and this could be exploited to run arbitrary commands on a system.

I'll open an issue to fix this. You opened an issue for it while I was writing this. (#73)

Not sure what I want to do with formatting at the moment, so I'm going to put this on hold and I'll come back to it later.

@alichtman
Copy link
Owner

Yeah, I guess I should really be using autopep8.

@alichtman alichtman merged commit f4beee0 into alichtman:master Oct 15, 2018
@alichtman
Copy link
Owner

I'm actually going to revert this since when I ran autopep8, git said the commit would change almost the whole file. Additionally, there's a risk that an unintended change would be introduced here, and I might miss it since there are so many lines of changes. I proofed it thoroughly before I merged it, but to be sure I'm just going to commit this myself.

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