mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Use ruff
to enforce python code formatting (#37117)
Requires servo/servo#37045 for deps and config. Testing: No need for tests to test tests. Fixes: servo/servo#37041 --------- Signed-off-by: zefr0x <zer0-x.7ty50@aleeas.com>
This commit is contained in:
parent
41ecfb53a1
commit
c96de69e80
67 changed files with 3021 additions and 3085 deletions
|
@ -17,27 +17,31 @@ import os
|
|||
def size(args):
|
||||
size = os.path.getsize(args.binary)
|
||||
print(size)
|
||||
with open(args.bmf_output, 'w', encoding='utf-8') as f:
|
||||
json.dump({
|
||||
args.variant: {
|
||||
'file-size': {
|
||||
'value': float(size),
|
||||
with open(args.bmf_output, "w", encoding="utf-8") as f:
|
||||
json.dump(
|
||||
{
|
||||
args.variant: {
|
||||
"file-size": {
|
||||
"value": float(size),
|
||||
}
|
||||
}
|
||||
}
|
||||
}, f, indent=4)
|
||||
},
|
||||
f,
|
||||
indent=4,
|
||||
)
|
||||
|
||||
|
||||
def merge(args):
|
||||
output: dict[str, object] = dict()
|
||||
for input_file in args.inputs:
|
||||
with open(input_file, 'r', encoding='utf-8') as f:
|
||||
with open(input_file, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
diff = set(data) & set(output)
|
||||
if diff:
|
||||
print("Duplicated keys:", diff)
|
||||
output = data | output
|
||||
|
||||
with open(args.bmf_output, 'w', encoding='utf-8') as f:
|
||||
with open(args.bmf_output, "w", encoding="utf-8") as f:
|
||||
json.dump(output, f, indent=4)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue