2018-09-02 15:54:18 +10:00
|
|
|
#!/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
|
|
|
|
2017-06-27 14:03:32 +01:00
|
|
|
import vigil.tools as tools
|
2016-11-19 13:50:07 +01:00
|
|
|
|
|
|
|
|
|
2016-11-19 16:47:05 +01:00
|
|
|
def tool_markup(tool):
|
2016-11-19 17:24:01 +01:00
|
|
|
url = tools.url_of_tool(tool)
|
2018-05-15 16:34:52 +10:00
|
|
|
return (tool.__name__ if url is None else f"[{tool.__name__}]({url})")
|
2016-11-19 16:47:05 +01:00
|
|
|
|
|
|
|
|
|
2018-05-31 15:10:53 +10:00
|
|
|
all_tools = ([(["*"], tools.generic_tools() +
|
|
|
|
|
[tools.git_blame, tools.git_log])] +
|
|
|
|
|
tools.TOOLS_FOR_EXTENSIONS)
|
2018-06-01 09:48:42 +10:00
|
|
|
tool_set = set()
|
|
|
|
|
extension_set = set()
|
2018-05-31 15:10:53 +10:00
|
|
|
for extensions, tools_ in all_tools:
|
2018-06-01 09:48:42 +10:00
|
|
|
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
|
2018-09-02 15:54:18 +10:00
|
|
|
# python3.7 -m pip install .
|
2017-07-10 18:38:18 +01:00
|
|
|
|
|
|
|
|
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
|
|
|
|
2018-06-01 09:48:42 +10:00
|
|
|
### Tools
|
2016-11-19 15:58:21 +01:00
|
|
|
|
2018-06-01 10:38:37 +10:00
|
|
|
Extensions({len(extension_set)-1}) | Tools({len(tool_set)})
|
2018-06-05 08:16:49 +10:00
|
|
|
----------:| -----""")
|
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),
|
2016-11-19 16:47:05 +01:00
|
|
|
" • ".join(tool_markup(tool) for tool in tools_)))
|