-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bad python for commit test * ? * Add autopep8 * Cleanup * bad formatting * testing again * One more test * That test didnt work for flake8 anyway
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import subprocess | ||
|
||
if __name__ == '__main__': | ||
output = subprocess.run(['git', 'rev-parse', '--show-toplevel'], capture_output=True) | ||
base_dir = output.stdout.decode('utf-8').strip() | ||
output = subprocess.run(['git', 'status', '--porcelain'], capture_output=True) | ||
all_files = output.stdout.decode('utf-8') | ||
modified_files = [] | ||
for line in all_files.split('\n'): | ||
if 'A' in line[0:2] or 'M' in line[0:2]: | ||
modified_files.append(os.path.join(base_dir, line[2:].strip())) | ||
|
||
for filename in modified_files: | ||
autopep8_call = ['autopep8', '--in-place', filename] | ||
subprocess.call(autopep8_call) | ||
subprocess.call(['git', 'add', filename]) |