
pip install black black --target-version py36 . Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters. Blackened code looks the same regardless of the project you're reading. Formatting becomes transparent after a while and you can focus on the content instead. Black makes code review faster by producing the smallest diffs possible. https://github.com/python/black
18 lines
578 B
Python
18 lines
578 B
Python
# Copyright 2007 Baptiste Lepilleur and The JsonCpp Authors
|
|
# Distributed under MIT license, or public domain if desired and
|
|
# recognized in your jurisdiction.
|
|
# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
|
|
|
from __future__ import print_function
|
|
import glob
|
|
import os.path
|
|
|
|
for path in glob.glob("*.json"):
|
|
text = file(path, "rt").read()
|
|
target = os.path.splitext(path)[0] + ".expected"
|
|
if os.path.exists(target):
|
|
print("skipping:", target)
|
|
else:
|
|
print("creating:", target)
|
|
file(target, "wt").write(text)
|