eris/make-readme.py

55 lines
1.2 KiB
Python
Raw Normal View History

#!/usr/bin/env python3.7
2016-11-19 16:26:23 +01:00
# -*- coding: utf-8 -*-
2016-11-19 13:50:07 +01:00
2018-01-12 15:00:39 +10:00
# Copyright (C) 2018 Andrew Hamilton. All rights reserved.
2016-11-19 15:52:48 +01:00
# Licensed under the Artistic License 2.0.
2016-11-19 13:50:07 +01:00
import vigil.tools as tools
2016-11-19 13:50:07 +01:00
def tool_markup(tool):
url = tools.url_of_tool(tool)
return (tool.__name__ if url is None else f"[{tool.__name__}]({url})")
2018-05-31 15:10:53 +10:00
all_tools = ([(["*"], tools.generic_tools() +
[tools.git_blame, tools.git_log])] +
tools.TOOLS_FOR_EXTENSIONS)
tool_set = set()
extension_set = set()
2018-05-31 15:10:53 +10:00
for extensions, tools_ in all_tools:
tool_set.update(tools_)
extension_set.update(extensions)
2018-05-31 15:10:53 +10:00
print(f"""\
2016-11-19 13:50:07 +01:00
# Vigil Code Monitor
### Summary
2017-04-12 10:14:36 +02:00
Vigil maintains an up-to-date set of reports for every file in a codebase.
2016-11-19 13:50:07 +01:00
### Installation
2018-03-16 11:33:50 +10:00
(Tested in Ubuntu 18.04)
2016-11-19 13:50:07 +01:00
# git clone https://github.com/ahamilton/vigil
# cd vigil
# ./install-dependencies
# python3.7 -m pip install .
To test its working properly:
# ./test-all
2016-11-19 13:50:07 +01:00
2017-06-27 14:20:30 +01:00
then to run:
2016-11-19 13:50:07 +01:00
2017-06-27 14:20:30 +01:00
# vigil <directory_path>
2016-11-19 13:50:07 +01:00
### Tools
2016-11-19 15:58:21 +01:00
Extensions({len(extension_set)-1}) | Tools({len(tool_set)})
----------:| -----""")
2017-07-19 09:40:54 +01:00
for extensions, tools_ in all_tools:
2016-11-19 15:58:21 +01:00
print("%s | %s" % (" ".join("." + extension for extension in extensions),
"".join(tool_markup(tool) for tool in tools_)))