tools/find-changed-builds.py: normalize code with pyflakes3/black -S
This commit is contained in:
parent
8ddae8d9c9
commit
0512044643
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import difflib
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -13,7 +12,9 @@ changed.discard('')
|
||||||
for appid in sorted(changed):
|
for appid in sorted(changed):
|
||||||
metadata_file = 'metadata/%s.yml' % appid
|
metadata_file = 'metadata/%s.yml' % appid
|
||||||
diff = subprocess.check_output(
|
diff = subprocess.check_output(
|
||||||
('git diff --no-color --diff-filter=d FETCH_HEAD...HEAD -- ' + metadata_file).split(' '),
|
(
|
||||||
|
'git diff --no-color --diff-filter=d FETCH_HEAD...HEAD -- ' + metadata_file
|
||||||
|
).split(' ')
|
||||||
)
|
)
|
||||||
|
|
||||||
with open(metadata_file) as fp:
|
with open(metadata_file) as fp:
|
||||||
|
@ -21,8 +22,10 @@ for appid in sorted(changed):
|
||||||
cmd = 'git apply --reverse'
|
cmd = 'git apply --reverse'
|
||||||
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
print(
|
||||||
file=sys.stderr)
|
Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
sys.exit(p.returncode)
|
sys.exit(p.returncode)
|
||||||
|
|
||||||
to_build = []
|
to_build = []
|
||||||
|
@ -32,8 +35,10 @@ for appid in sorted(changed):
|
||||||
cmd = 'git apply'
|
cmd = 'git apply'
|
||||||
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
print(
|
||||||
file=sys.stderr)
|
Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
sys.exit(p.returncode)
|
sys.exit(p.returncode)
|
||||||
|
|
||||||
previous_builds = dict()
|
previous_builds = dict()
|
||||||
|
@ -52,8 +57,10 @@ for appid in sorted(changed):
|
||||||
cmd = 'git checkout -- ' + metadata_file
|
cmd = 'git checkout -- ' + metadata_file
|
||||||
p = subprocess.run(cmd.split(' '), stdout=subprocess.DEVNULL)
|
p = subprocess.run(cmd.split(' '), stdout=subprocess.DEVNULL)
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
print(
|
||||||
file=sys.stderr)
|
Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
sys.exit(p.returncode)
|
sys.exit(p.returncode)
|
||||||
with open(metadata_file) as fp:
|
with open(metadata_file) as fp:
|
||||||
data = yaml.safe_load(fp)
|
data = yaml.safe_load(fp)
|
||||||
|
|
Loading…
Reference in New Issue