From afba66c526c8d014d704e9e097896db581ec0a6c Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Mon, 9 Dec 2024 13:36:16 +0700 Subject: [PATCH] style: end json file dumps with a newline --- gen_addresses.py | 2 ++ gen_core_pools.py | 1 + gen_current_permissions.py | 1 + gen_mono_addressbook.py | 2 ++ gen_pools_and_gauges.py | 3 +++ gen_subgraph_urls.py | 1 + 6 files changed, 10 insertions(+) diff --git a/gen_addresses.py b/gen_addresses.py index 54f6b8b7..4130a033 100644 --- a/gen_addresses.py +++ b/gen_addresses.py @@ -15,8 +15,10 @@ def write_addressbooks(chainlist=AddrBook.chain_ids_by_name.keys()): flatbook = AddrBook(chain).generate_flatbook() with open(f"outputs/{chain}.json", "w") as f: json.dump(dict(sorted(flatbook.items())), f, indent=2) + f.write("\n") with open(f"outputs/{chain}_reverse.json", "w") as f: json.dump(reverse_dict(flatbook), f, indent=2) + f.write("\n") def main(): diff --git a/gen_core_pools.py b/gen_core_pools.py index 1c98e461..e6c588af 100644 --- a/gen_core_pools.py +++ b/gen_core_pools.py @@ -14,6 +14,7 @@ def main(): # dump the collected dict to json file with open("outputs/core_pools.json", "w") as f: json.dump(core_pools, f, indent=2) + f.write("\n") if __name__ == "__main__": diff --git a/gen_current_permissions.py b/gen_current_permissions.py index 94bc3a30..0f29c1e0 100644 --- a/gen_current_permissions.py +++ b/gen_current_permissions.py @@ -54,6 +54,7 @@ def generate_chain_files(chain): permissions = build_chain_permissions_list(chain) with open(f"outputs/permissions/active/{chain}.json", "w") as f: json.dump(permissions, f, indent=2) + f.write("\n") def main(): diff --git a/gen_mono_addressbook.py b/gen_mono_addressbook.py index 36d4c780..c6da0d3a 100644 --- a/gen_mono_addressbook.py +++ b/gen_mono_addressbook.py @@ -38,6 +38,7 @@ def main(): results = {"active": active, "old": old} with open("outputs/deployments.json", "w") as f: json.dump(results, f, indent=2) + f.write("\n") ### Add extras for chain in active.keys(): with open("extras/multisigs.json", "r") as f: @@ -83,6 +84,7 @@ def main(): results = {"active": active, "old": old} with open("outputs/addressbook.json", "w") as f: json.dump(results, f, indent=2) + f.write("\n") def process_deployments(deployments, old=False): diff --git a/gen_pools_and_gauges.py b/gen_pools_and_gauges.py index 89e4e214..062ded2e 100644 --- a/gen_pools_and_gauges.py +++ b/gen_pools_and_gauges.py @@ -111,10 +111,13 @@ def main(): # dump all collected dicts to json files with open(f"outputs/pools.json", "w") as f: json.dump(pools, f, indent=2) + f.write("\n") with open("outputs/gauges.json", "w") as f: json.dump(gauges, f, indent=2) + f.write("\n") with open("outputs/root_gauges.json", "w") as f: json.dump(root_gauges, f, indent=2) + f.write("\n") if __name__ == "__main__": diff --git a/gen_subgraph_urls.py b/gen_subgraph_urls.py index 57d3c2e7..fbf4214c 100644 --- a/gen_subgraph_urls.py +++ b/gen_subgraph_urls.py @@ -35,6 +35,7 @@ def main(): # dump the collected dict to json file with open("outputs/subgraph_urls.json", "w") as f: json.dump(urls, f, indent=2) + f.write("\n") if __name__ == "__main__":