Rename the project to Eris.

This commit is contained in:
Andrew Hamilton 2018-09-17 23:59:38 +10:00
parent a060c7f3ae
commit 8e5cc0eac9
34 changed files with 109 additions and 112 deletions

View file

@ -1,15 +1,15 @@
# Vigil Code Monitor
# Eris Code Monitor
### Summary
Vigil maintains an up-to-date set of reports for every file in a codebase.
Eris maintains an up-to-date set of reports for every file in a codebase.
### Installation
(Tested in Ubuntu 18.04)
# git clone https://github.com/ahamilton/vigil
# cd vigil
# git clone https://github.com/ahamilton/eris
# cd eris
# ./install-dependencies
# python3.7 -m pip install .
@ -19,14 +19,14 @@ To test its working properly:
then to run:
# vigil <directory_path>
# eris <directory_path>
### Tools
Extensions(93) | Tools(62)
Extensions(94) | Tools(61)
----------:| -----
.* | [contents](http://pygments.org/) • metadata • [git_blame](https://git-scm.com/docs/git-blame) • [git_log](https://git-scm.com/docs/git-log)
.py | [python_syntax](https://en.wikipedia.org/wiki/Python_syntax_and_semantics) • [python_unittests](https://docs.python.org/3/library/unittest.html) • [pydoc](https://docs.python.org/3/library/pydoc.html) • [mypy](http://www.mypy-lang.org/) • [python_coverage](http://nedbatchelder.com/code/coverage/) • [pycodestyle](https://pypi.python.org/pypi/pycodestyle) • [pydocstyle](http://pydocstyle.readthedocs.org/) • [pyflakes](https://launchpad.net/pyflakes) • [pylint](http://www.pylint.org/) • [python_gut](https://github.com/ahamilton/vigil/blob/master/gut.py) • [python_modulefinder](https://docs.python.org/3/library/modulefinder.html) • [dis](https://docs.python.org/3/library/dis.html) • [python_mccabe](https://github.com/flintwork/mccabe) • [bandit](https://wiki.openstack.org/wiki/Security/Projects/Bandit)
.py | [python_syntax](https://en.wikipedia.org/wiki/Python_syntax_and_semantics) • [python_unittests](https://docs.python.org/3/library/unittest.html) • [pydoc](https://docs.python.org/3/library/pydoc.html) • [mypy](package) • [python_coverage](http://nedbatchelder.com/code/coverage/) • [pycodestyle](https://pypi.python.org/pypi/pycodestyle) • [pydocstyle](http://pydocstyle.readthedocs.org/) • [pyflakes](https://launchpad.net/pyflakes) • [pylint](http://www.pylint.org/) • [python_gut](https://github.com/ahamilton/eris/blob/master/gut.py) • [python_modulefinder](https://docs.python.org/3/library/modulefinder.html) • [dis](https://docs.python.org/3/library/dis.html) • [python_mccabe](https://github.com/flintwork/mccabe) • [bandit](https://wiki.openstack.org/wiki/Security/Projects/Bandit)
.pl .pm .t | [perl_syntax](https://en.wikipedia.org/wiki/Perl) • [perldoc](http://perldoc.perl.org/) • [perltidy](http://perltidy.sourceforge.net/)
.pod .pod6 | [perldoc](http://perldoc.perl.org/)
.java | [uncrustify](https://github.com/uncrustify/uncrustify)
@ -53,5 +53,5 @@ Extensions(93) | Tools(62)
.so | [nm](https://linux.die.net/man/1/nm)
.deb | [dpkg_contents](https://wiki.debian.org/Teams/Dpkg) • [dpkg_info](https://wiki.debian.org/Teams/Dpkg)
.rpm | [rpm](http://rpm.org/)
.png .jpg .gif .bmp .ppm .tiff .tga | [identify](http://www.imagemagick.org/script/identify.php) • [pil](http://python-pillow.github.io/) • [pil_half](http://python-pillow.github.io/)
.png .jpg .gif .bmp .ppm .tif .tiff .tga | [identify](http://www.imagemagick.org/script/identify.php) • [pil](http://python-pillow.github.io/)
.mkv .mka .mks .ogg .ogm .avi .wav .mpeg .mpg .vob .mp4 .mpgv .mpv .m1v .m2v .mp2 .mp3 .asf .wma .wmv .qt .mov .rm .rmvb .ra .ifo .ac3 .dts .aac .flac .aiff .aifc .au .iff .flv .srt .ssa .ass .sami | [mediainfo](https://mediaarea.net/MediaInfo)

2
TODO
View file

@ -3,7 +3,6 @@ Todo
- Make a snap build work.
- Make a flatpak build work.
- Check the appimage build.
- Rename project to Eris.
Todo (tool related)
@ -172,6 +171,7 @@ Done
- Add shellcheck tool for shell scripts.
- Add "git log <path>".
- Change to using python3.7.
- Rename project to Eris.
A-syntax, B-tests, C-auto docs, D-lint, E-coverage, F-profile, G-tidy, H-import deps
A B C D E F G H

View file

@ -1,8 +1,8 @@
[Desktop Entry]
Type=Application
Name=Vigil
Name=Eris
Comment=
Exec=vigil
Exec=eris
Terminal=true
Icon=vigil
Icon=eris
Categories=Application;

View file

@ -4,14 +4,14 @@
# Copyright (C) 2015-2018 Andrew Hamilton. All rights reserved.
# Licensed under the Artistic License 2.0.
"""Vigil Code Monitor
"""Eris Code Monitor
Vigil maintains an up-to-date set of reports for every file in a codebase.
Eris maintains an up-to-date set of reports for every file in a codebase.
A status indicator summarises the state of each report, and a report is viewed
by selecting this status indicator with the cursor.
The reports are cached in the codebase's root directory in a ".vigil"
The reports are cached in the codebase's root directory in a ".eris"
directory.
"""
@ -34,20 +34,20 @@ import docopt
import pygments.styles
import pyinotify
from vigil import fill3
from vigil import terminal
from vigil import termstr
from vigil import tools
from vigil import worker
from eris import fill3
from eris import terminal
from eris import termstr
from eris import tools
from eris import worker
USAGE = """
Usage:
vigil [options] <directory>
vigil -h | --help
eris [options] <directory>
eris -h | --help
Example:
# vigil my_project
# eris my_project
Options:
-h, --help Show the full help.
@ -1082,7 +1082,7 @@ def manage_cache(root_path):
timestamp_path = os.path.join(cache_path, "creation_time")
if os.path.exists(cache_path) and \
os.stat(__file__).st_mtime > os.stat(timestamp_path).st_mtime:
print("Vigil has been updated, so clearing the cache and"
print("Eris has been updated, so clearing the cache and"
" recalculating all results...")
shutil.rmtree(cache_path)
if not os.path.exists(cache_path):
@ -1125,7 +1125,7 @@ def check_arguments():
def entry_point():
root_path, worker_count, editor_command, theme = check_arguments()
with terminal.terminal_title("vigil: " + os.path.basename(root_path)):
with terminal.terminal_title("eris: " + os.path.basename(root_path)):
manage_cache(root_path)
with chdir(root_path): # FIX: Don't change directory if possible.
loop = asyncio.get_event_loop()

View file

@ -12,11 +12,11 @@ import os
import signal
import sys
import vigil.urwid
import vigil.urwid.raw_display
import eris.urwid
import eris.urwid.raw_display
import vigil.terminal as terminal
import vigil.termstr as termstr
import eris.terminal as terminal
import eris.termstr as termstr
def appearance_is_valid(appearance):
@ -467,7 +467,7 @@ def patch_screen(widget):
@contextlib.contextmanager
def _urwid_screen():
screen = vigil.urwid.raw_display.Screen()
screen = eris.urwid.raw_display.Screen()
screen.set_mouse_tracking(True)
screen.start()
try:

View file

@ -15,17 +15,17 @@ import weakref
import pygments.formatters.terminal256
import vigil.ColorMap
import vigil.terminal as terminal
import eris.ColorMap
import eris.terminal as terminal
xterm_colormap = vigil.ColorMap.XTermColorMap()
xterm_colormap = eris.ColorMap.XTermColorMap()
@functools.lru_cache()
def xterm_color_to_rgb(color_index):
"""Return the rgb color of an xterm color."""
return vigil.ColorMap._rgb(xterm_colormap.colors[color_index])
return eris.ColorMap._rgb(xterm_colormap.colors[color_index])
def _cache_first_result(user_function):

View file

@ -28,16 +28,16 @@ import pygments.lexers
import pygments.styles
import toml
import vigil
import vigil.fill3 as fill3
import vigil.gut as gut
import vigil.lscolors as lscolors
import vigil.termstr as termstr
import eris
import eris.fill3 as fill3
import eris.gut as gut
import eris.lscolors as lscolors
import eris.termstr as termstr
PYTHON_VERSION = "3.7"
PYTHON_EXECUTABLE = "python" + PYTHON_VERSION
CACHE_PATH = ".vigil"
CACHE_PATH = ".eris"
if "PYGMENT_STYLE" not in os.environ:
@ -382,7 +382,7 @@ def pylint(path):
"--errors-only", path])
@deps(url="https://github.com/ahamilton/vigil/blob/master/gut.py")
@deps(url="https://github.com/ahamilton/eris/blob/master/gut.py")
def python_gut(path):
with open(path) as module_file:
output = gut.gut_module(module_file.read())
@ -573,7 +573,7 @@ def make_tool_function(dependencies, url, command, success_status=None,
return func
with importlib.resources.open_text(vigil, "tools.toml") as tools_toml_file:
with importlib.resources.open_text(eris, "tools.toml") as tools_toml_file:
tools_toml = toml.load(tools_toml_file)
tools_for_extensions = tools_toml["tools_for_extensions"]
del tools_toml["tools_for_extensions"]
@ -585,7 +585,7 @@ for tool_name, tool_toml in tools_toml.items():
#############################
LOG_PATH = os.path.join(os.getcwd(), "vigil.log")
LOG_PATH = os.path.join(os.getcwd(), "eris.log")
def log_error(message=None):

View file

@ -234,7 +234,7 @@ tools_for_extensions = [
[yamllint]
dependencies = ["pip3/yamllint"]
url = "yamllint"
url = "https://github.com/adrienverge/yamllint"
command = "python3.7 -m yamllint"
[mediainfo]

View file

@ -28,7 +28,7 @@ import sys
import termios
import tty
from vigil.urwid import escape
from eris.urwid import escape
class Screen:

View file

@ -10,15 +10,15 @@ import os
import sys
import pickle
import vigil.fill3 as fill3
import vigil.tools as tools
import eris.fill3 as fill3
import eris.tools as tools
USAGE = """Usage:
vigil-webserver <directory>
eris-webserver <directory>
Example:
vigil-webserver my_project
eris-webserver my_project
"""

View file

@ -7,7 +7,7 @@ import asyncio
import os
import signal
import vigil.tools as tools
import eris.tools as tools
class Worker:
@ -24,7 +24,7 @@ class Worker:
async def create_process(self):
create = asyncio.create_subprocess_exec(
"vigil-worker", stdin=asyncio.subprocess.PIPE,
"eris-worker", stdin=asyncio.subprocess.PIPE,
stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE,
preexec_fn=os.setsid)
self.process = await create

View file

@ -9,12 +9,12 @@ set -e
DIST_ID=$(cat /etc/os-release | grep "^ID=" | cut -d "=" -f 2)
if [ $DIST_ID != "ubuntu" ]; then
echo "Vigil can only be installed on Ubuntu."
echo "Eris can only be installed on Ubuntu."
exit 1
fi
echo "Installing the dependencies of the vigil script..."
echo "Installing the dependencies of the eris script..."
sudo apt --yes install python3.7 util-linux
python3.7 -m pip install pyinotify pygments docopt pillow toml
echo
echo "Installing all the tools vigil may need..."
echo "Installing all the tools eris may need..."
./install-tools

View file

@ -5,11 +5,11 @@
import subprocess
import vigil.tools
import eris.tools
pip_deps, pip3_deps, dist_deps = set(), set(), set()
for dependency in vigil.tools.dependencies():
for dependency in eris.tools.dependencies():
if "/" in dependency:
pip_version, pip_dependency = dependency.split("/")
(pip_deps if pip_version == "pip" else pip3_deps).add(pip_dependency)
@ -24,5 +24,5 @@ if pip_deps:
subprocess.run(["python", "-m", "pip", "install"] + list(pip_deps),
check=True)
if pip3_deps:
subprocess.run(["python" + vigil.tools.PYTHON_VERSION, "-m", "pip",
subprocess.run(["python" + eris.tools.PYTHON_VERSION, "-m", "pip",
"install"] + list(pip3_deps), check=True)

View file

@ -12,7 +12,7 @@ import tempfile
import test_distributions
VIGIL_PATH = os.path.realpath(os.path.dirname(__file__))
ERIS_PATH = os.path.realpath(os.path.dirname(__file__))
cmd = test_distributions.cmd
@ -54,7 +54,7 @@ def make_ubuntu_base():
return base_paths
def install_vigil():
def install_eris():
run_in_container = test_distributions.run_in_container
run_in_container("ubuntu", "./install-dependencies")
# libunionpreload doesn't trick shebangs?
@ -82,9 +82,9 @@ def install_vigil():
def make_app_dir(app_dir, new_paths):
os.mkdir(app_dir)
make_sub_container("ubuntu", app_dir, new_paths)
cmd(f"cp -a {VIGIL_PATH}/tests {app_dir}")
cmd(f"cp -a {VIGIL_PATH}/test-all {app_dir}")
cmd(f"cp {VIGIL_PATH}/appimage/* {app_dir}")
cmd(f"cp -a {ERIS_PATH}/tests {app_dir}")
cmd(f"cp -a {ERIS_PATH}/test-all {app_dir}")
cmd(f"cp {ERIS_PATH}/appimage/* {app_dir}")
# if not os.path.exists("libunionpreload.so"):
# make_libunionpreload()
# cmd("cp libunionpreload.so " + app_dir)
@ -101,11 +101,11 @@ def main(work_path):
assert os.getuid() == 0 and os.getgid() == 0, "Need to be root."
os.chdir(work_path)
base_paths = make_ubuntu_base()
install_vigil()
install_eris()
post_install_paths = relative_paths("ubuntu", all_paths("ubuntu"))
new_paths = set(post_install_paths) - set(base_paths)
new_paths = filter_paths(new_paths, "/var/cache/apt/archives")
app_dir = "vigil.AppDir"
app_dir = "eris.AppDir"
if os.path.exists(app_dir):
cmd("sudo rm -rf " + app_dir)
make_app_dir(app_dir, new_paths)

View file

@ -5,7 +5,7 @@
# Licensed under the Artistic License 2.0.
import vigil.tools as tools
import eris.tools as tools
def tool_markup(tool):
@ -22,18 +22,18 @@ for extensions, tools_ in all_tools:
tool_set.update(tools_)
extension_set.update(extensions)
print(f"""\
# Vigil Code Monitor
# Eris Code Monitor
### Summary
Vigil maintains an up-to-date set of reports for every file in a codebase.
Eris maintains an up-to-date set of reports for every file in a codebase.
### Installation
(Tested in Ubuntu 18.04)
# git clone https://github.com/ahamilton/vigil
# cd vigil
# git clone https://github.com/ahamilton/eris
# cd eris
# ./install-dependencies
# python3.7 -m pip install .
@ -43,7 +43,7 @@ To test its working properly:
then to run:
# vigil <directory_path>
# eris <directory_path>
### Tools

View file

@ -10,16 +10,16 @@ except ImportError:
from distutils.core import setup
setup(name="vigil",
setup(name="eris",
version="17.06",
description=("Vigil maintains an up-to-date set of reports for every"
description=("Eris maintains an up-to-date set of reports for every"
" file in a codebase."),
url="https://github.com/ahamilton/vigil",
url="https://github.com/ahamilton/eris",
author="Andrew Hamilton",
license="Artistic 2.0",
packages=["vigil", "vigil.urwid"],
package_data={"vigil": ["LS_COLORS.sh", "tools.toml"]},
packages=["eris", "eris.urwid"],
package_data={"eris": ["LS_COLORS.sh", "tools.toml"]},
entry_points={"console_scripts":
["vigil=vigil.__main__:entry_point",
"vigil-worker=vigil.worker:main",
"vigil-webserver=vigil.webserver:main"]})
["eris=eris.__main__:entry_point",
"eris-worker=eris.worker:main",
"eris-webserver=eris.webserver:main"]})

View file

@ -10,7 +10,7 @@ import sys
import tempfile
VIGIL_PATH = os.path.realpath(os.path.dirname(__file__))
ERIS_PATH = os.path.realpath(os.path.dirname(__file__))
def cmd(command):
@ -32,7 +32,7 @@ def umount_squashfs_iso(mount_point):
def run_in_container(container, command):
option = "--directory" if os.path.isdir(container) else "--image"
cmd(f"sudo systemd-nspawn --quiet --chdir=/vigil --overlay={VIGIL_PATH}:/vigil "
cmd(f"sudo systemd-nspawn --quiet --chdir=/eris --overlay={ERIS_PATH}:/eris "
f'{option}={container} /bin/bash --login -c "{command}"')
@ -135,16 +135,16 @@ def main():
else:
print(f"Building {distribution} container...")
globals()["build_" + distribution]()
print(f"Installing vigil's dependencies in {distribution}...")
print(f"Installing eris's dependencies in {distribution}...")
run_in_container(distribution, "./install-dependencies")
print(f"Installing vigil in {distribution}...")
print(f"Installing eris in {distribution}...")
run_in_container(distribution, "apt-get install --yes python3-pip")
run_in_container(distribution, "pip3 install .")
print(f"Testing vigil in {distribution}...")
print(f"Testing eris in {distribution}...")
run_in_container(distribution, "./test-all")
print(f"Running vigil in {distribution}...")
run_in_container(distribution, "vigil --help")
print(f"Successfully installed vigil in {distribution}.")
print(f"Running eris in {distribution}...")
run_in_container(distribution, "eris --help")
print(f"Successfully installed eris in {distribution}.")
print(f"Removing {distribution} container...")
try:
globals()["remove_" + distribution]()

View file

@ -14,8 +14,8 @@ import unittest
os.environ["TERM"] = "xterm-256color"
import golden
import vigil.fill3 as fill3
import vigil.__main__ as __main__
import eris.fill3 as fill3
import eris.__main__ as __main__
_DIMENSIONS = (100, 60)
@ -226,7 +226,7 @@ class MainTestCase(unittest.TestCase):
is_being_tested=True)
for file_name in ["summary.pickle", "creation_time", "log",
"foo-metadata", "foo-contents"]:
self.assertTrue(os.path.exists(".vigil/" + file_name))
self.assertTrue(os.path.exists(".eris/" + file_name))
self.assertEqual(_mount_total(), mount_total)
# self.assertEqual(_tmp_total(), tmp_total)
temp_dir = tempfile.mkdtemp()

View file

@ -6,8 +6,8 @@
import unittest
import vigil.fill3 as fill3
import vigil.termstr as termstr
import eris.fill3 as fill3
import eris.termstr as termstr
class WidgetTests(unittest.TestCase):

View file

@ -1,12 +1,12 @@
(B┌────────────────────────────────────────────── Help ──────────────────────────────────────────────┐
Vigil Code Monitor │
Eris Code Monitor
│ │
Vigil maintains an up-to-date set of reports for every file in a codebase. │
Eris maintains an up-to-date set of reports for every file in a codebase.
│ │
│A status indicator summarises the state of each report, and a report is viewed │
│by selecting this status indicator with the cursor. │
│ │
│The reports are cached in the codebase's root directory in a ".vigil"
│The reports are cached in the codebase's root directory in a ".eris"
│directory. │
│ │
│Keys: │

View file

@ -1,6 +1,6 @@
#[31m===#[0mSORRY!#[31m===#[0m
Two terms in a row across lines (missing semicolon or comma?)
at /tmp/vigil/golden-files/./input/perl6.p6:30
at /tmp/eris/golden-files/./input/perl6.p6:30
------> #[32msay 'Hello from Perl 6!'#[33m⏏#[31m<EOL>#[0m
expecting any of:
infix
@ -11,6 +11,6 @@ at /tmp/vigil/golden-files/./input/perl6.p6:30
statement modifier loop
Other potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?)
at /tmp/vigil/golden-files/./input/perl6.p6:11
at /tmp/eris/golden-files/./input/perl6.p6:11
------> #[32mregex #[33m⏏#[31mhttp-verb {#[0m

View file

@ -1,6 +1,6 @@
#[31m===#[0mSORRY!#[31m===#[0m
Two terms in a row across lines (missing semicolon or comma?)
at /tmp/vigil/golden-files/./input/perl6.pl:30
at /tmp/eris/golden-files/./input/perl6.pl:30
------> #[32msay 'Hello from Perl 6!'#[33m⏏#[31m<EOL>#[0m
expecting any of:
infix
@ -11,6 +11,6 @@ at /tmp/vigil/golden-files/./input/perl6.pl:30
statement modifier loop
Other potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?)
at /tmp/vigil/golden-files/./input/perl6.pl:11
at /tmp/eris/golden-files/./input/perl6.pl:11
------> #[32mregex #[33m⏏#[31mhttp-verb {#[0m

View file

@ -6,7 +6,7 @@
import textwrap
import unittest
import vigil.gut as gut
import eris.gut as gut
class GutTestCase(unittest.TestCase):

View file

@ -12,7 +12,7 @@ import subprocess
import tempfile
import unittest
import vigil.lscolors as lscolors
import eris.lscolors as lscolors
class TempDirTestCase(unittest.TestCase):

View file

@ -9,8 +9,8 @@ import unittest
os.environ["TERM"] = "xterm-256color"
from vigil.termstr import TermStr, CharStyle
import vigil.termstr as termstr
from eris.termstr import TermStr, CharStyle
import eris.termstr as termstr
class CacheFirstResultTestCase(unittest.TestCase):

View file

@ -12,12 +12,12 @@ import unittest.mock
os.environ["TERM"] = "xterm-256color"
import golden
import vigil.fill3 as fill3
import vigil.tools as tools
import eris.fill3 as fill3
import eris.tools as tools
os.environ["TZ"] = "GMT"
VIGIL_ROOT = os.path.dirname(__file__)
ERIS_ROOT = os.path.dirname(__file__)
class ExecutablesTestCase(unittest.TestCase):
@ -47,11 +47,11 @@ def chdir(path):
def result_path(tool, input_filename):
filename = tool.__name__ + "-" + input_filename.replace(".", "_")
return os.path.join(VIGIL_ROOT, "golden-files", "results", filename)
return os.path.join(ERIS_ROOT, "golden-files", "results", filename)
def run_tool(tool, input_filename):
with chdir(os.path.join(VIGIL_ROOT, "golden-files")):
with chdir(os.path.join(ERIS_ROOT, "golden-files")):
return tool(os.path.join(".", "input", input_filename))
@ -222,9 +222,6 @@ class ToolsTestCase(unittest.TestCase):
self._test_tool(tools.pil, [("circle." + extension,
tools.Status.normal)])
def test_pil_half(self):
self._test_tool(tools.pil_half, [("circle.png", tools.Status.normal)])
class LruCacheWithEvictionTestCase(unittest.TestCase):

View file

@ -10,8 +10,8 @@ import shutil
import tempfile
import unittest
import vigil.tools as tools
import vigil.worker as worker
import eris.tools as tools
import eris.worker as worker
class WorkerTestCase(unittest.TestCase):