python: fix flake8 warnings and format with black
Most of the flake8 warnings in this repository were fairly trivial,
so fixed them. The "openbmctool" is 7000+ lines of pretty heavily
warned code, so just disabling that one. Format everything with
black.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Icb3f6ee9bf03dece58785f7af00617c87a84aa65
diff --git a/autojson/autojson.py b/autojson/autojson.py
index e4f2818..77dba50 100755
--- a/autojson/autojson.py
+++ b/autojson/autojson.py
@@ -6,9 +6,11 @@
from sys import argv
for file in argv[1:]:
- print("formatting file {}".format(file))
- with open(file) as f:
- j = json.load(f)
+ print("formatting file {}".format(file))
+ with open(file) as f:
+ j = json.load(f)
- with open(file, 'w') as f:
- f.write(json.dumps(j, indent=4, sort_keys=True, separators=(',', ': ')))
+ with open(file, "w") as f:
+ f.write(
+ json.dumps(j, indent=4, sort_keys=True, separators=(",", ": "))
+ )