def main(): lintlist, configs = parse_all() lints = {} for lint in lintlist: lints[lint.name] = parse_lint_def(lint) if lint.name in configs: lints[lint.name]['docs']['Configuration'] = \ CONF_TEMPLATE % configs[lint.name] outfile = sys.argv[1] if len(sys.argv) > 1 else "util/gh-pages/lints.json" with open(outfile, "w") as fp: json.dump(list(lints.values()), fp, indent=2) log.info("wrote JSON for great justice")
def main(): if len(sys.argv) < 2: print("Error: specify output directory") return outdir = sys.argv[1] versions = [ dir for dir in os.listdir(outdir) if not dir.startswith(".") and os.path.isdir(os.path.join(outdir, dir)) ] versions.sort(key=key) with open(os.path.join(outdir, "versions.json"), "w") as fp: json.dump(versions, fp, indent=2) log.info("wrote JSON for great justice")