From b922f29e0737f42fe3537973091fee3b816731fa Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 27 Sep 2016 13:30:08 +0200 Subject: [PATCH] Changes for ubuntu 16.04. --- README.md | 2 +- golden-files/input/javaversion.class | Bin 510 -> 0 bytes golden-files/results/bcpp-hello_cpp | 2 +- .../disassemble_pyc-hi3_cpython-34_pyc | 2 +- golden-files/results/perl6_syntax-perl6_p6 | 28 +++++++++------- golden-files/results/perl_syntax-perl6_pl | 28 +++++++++------- golden-files/results/tidy-hi_html | 22 ++++++------- golden-files/results/uncrustify-hello_c | 2 +- golden-files/results/uncrustify-hello_cpp | 2 +- sandbox_fs.py | 4 +-- tools.py | 31 ++++-------------- tools_test.py | 8 +---- 12 files changed, 58 insertions(+), 73 deletions(-) delete mode 100644 golden-files/input/javaversion.class diff --git a/README.md b/README.md index 62988e4..7b99693 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Installation -To run vigil: (Tested in Ubuntu 15.10 in gnome-terminal and stterm) +To run vigil: (Tested in Ubuntu 16.04 in gnome-terminal and stterm) # git clone https://github.com/ahamilton/vigil # cd vigil diff --git a/golden-files/input/javaversion.class b/golden-files/input/javaversion.class deleted file mode 100644 index d62585b0ecd259dc3d661247c323788c927ff140..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 510 zcmZutO;5r=5Pi#6p;SSzh#(>tQ%$5l0OQ5P6HyWj7f(xF$r9RN#n}O8;*si zHlY4uri4$EgfTtXE1xoSdt_3PRl)rZDUO8dMd4ILYQb>oY#HZ2#8B2o+)XtGW2&_$ zv>1Dv&;TuDX#e^o!1NL*nsjSWW|Y(CZ(z? diff --git a/golden-files/results/bcpp-hello_cpp b/golden-files/results/bcpp-hello_cpp index 125969d..71b0705 100644 --- a/golden-files/results/bcpp-hello_cpp +++ b/golden-files/results/bcpp-hello_cpp @@ -1,4 +1,4 @@ -#include   +#include     using namespace std;    diff --git a/golden-files/results/disassemble_pyc-hi3_cpython-34_pyc b/golden-files/results/disassemble_pyc-hi3_cpython-34_pyc index 5944e65..87d43a2 100644 --- a/golden-files/results/disassemble_pyc-hi3_cpython-34_pyc +++ b/golden-files/results/disassemble_pyc-hi3_cpython-34_pyc @@ -1,6 +1,6 @@ >> 0 <238> 3340 >> 3 UNARY_POSITIVE - >> 4 <152> 46083 + >> 4 BUILD_TUPLE_UNPACK 46083 7 YIELD_VALUE 8 INPLACE_FLOOR_DIVIDE 9 <0> diff --git a/golden-files/results/perl6_syntax-perl6_p6 b/golden-files/results/perl6_syntax-perl6_p6 index 7d617ac..9f4a56f 100644 --- a/golden-files/results/perl6_syntax-perl6_p6 +++ b/golden-files/results/perl6_syntax-perl6_p6 @@ -1,12 +1,16 @@ -Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?) -===SORRY!=== Error while compiling ./input/perl6.p6 -Two terms in a row -at ./input/perl6.p6:30 -------> ⏏say 'here'; - expecting any of: - postfix - infix stopper - infix or meta-infix - statement end - statement modifier - statement modifier loop \ No newline at end of file +===SORRY!=== +Two terms in a row across lines (missing semicolon or comma?) +at /home/ahamilton/code/vigil/golden-files/./input/perl6.p6:30 +------> say 'Hello from Perl 6!'⏏ + expecting any of: + infix + infix stopper + postfix + statement end + statement modifier + statement modifier loop +Other potential difficulties: + Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?) + at /home/ahamilton/code/vigil/golden-files/./input/perl6.p6:11 + ------> regex ⏏http-verb { + \ No newline at end of file diff --git a/golden-files/results/perl_syntax-perl6_pl b/golden-files/results/perl_syntax-perl6_pl index 089cf7a..43768f4 100644 --- a/golden-files/results/perl_syntax-perl6_pl +++ b/golden-files/results/perl_syntax-perl6_pl @@ -1,12 +1,16 @@ -Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?) -===SORRY!=== Error while compiling ./input/perl6.pl -Two terms in a row -at ./input/perl6.pl:30 -------> ⏏say 'here'; - expecting any of: - postfix - infix stopper - infix or meta-infix - statement end - statement modifier - statement modifier loop \ No newline at end of file +===SORRY!=== +Two terms in a row across lines (missing semicolon or comma?) +at /home/ahamilton/code/vigil/golden-files/./input/perl6.pl:30 +------> say 'Hello from Perl 6!'⏏ + expecting any of: + infix + infix stopper + postfix + statement end + statement modifier + statement modifier loop +Other potential difficulties: + Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?) + at /home/ahamilton/code/vigil/golden-files/./input/perl6.pl:11 + ------> regex ⏏http-verb { + \ No newline at end of file diff --git a/golden-files/results/tidy-hi_html b/golden-files/results/tidy-hi_html index a64bd39..d91d40f 100644 --- a/golden-files/results/tidy-hi_html +++ b/golden-files/results/tidy-hi_html @@ -1,11 +1,11 @@ - - - - - - - -hello - - \ No newline at end of file + + + + + + + +hello + + \ No newline at end of file diff --git a/golden-files/results/uncrustify-hello_c b/golden-files/results/uncrustify-hello_c index 14b344a..9f7d0a2 100644 --- a/golden-files/results/uncrustify-hello_c +++ b/golden-files/results/uncrustify-hello_c @@ -1,4 +1,4 @@ -#include   +#include     int main()  {  diff --git a/golden-files/results/uncrustify-hello_cpp b/golden-files/results/uncrustify-hello_cpp index 125969d..71b0705 100644 --- a/golden-files/results/uncrustify-hello_cpp +++ b/golden-files/results/uncrustify-hello_cpp @@ -1,4 +1,4 @@ -#include   +#include     using namespace std;    diff --git a/sandbox_fs.py b/sandbox_fs.py index ddeaa01..74134f3 100644 --- a/sandbox_fs.py +++ b/sandbox_fs.py @@ -54,8 +54,8 @@ def _parse_proc_mounts(): def _find_mounts(): all_mounts = set(part[1] for part in _parse_proc_mounts()) - mount_points = {"/", "/usr", "/bin", "/etc", "/lib", "/dev", "/proc", - "/home", "/boot", "/opt", "/run", "/root", "/var", "/tmp"} + mount_points = {"/", "/usr", "/bin", "/etc", "/lib", "/dev", "/home", + "/boot", "/opt", "/run", "/root", "/var", "/tmp"} return all_mounts.intersection(mount_points) diff --git a/tools.py b/tools.py index 4bc48ec..b382ca2 100644 --- a/tools.py +++ b/tools.py @@ -364,7 +364,9 @@ python_profile.dependencies = {"python", "python3"} def pep8(path): - return _run_command([_python_version(path), "-m", "pep8", path]) + cmd = (["pep8"] if _python_version(path) == "python" + else ["python3", "-m", "pep8"]) + return _run_command(cmd + [path]) pep8.dependencies = {"pep8", "python3-pep8"} @@ -439,7 +441,7 @@ def _perl_version(path): def perl_syntax(path): return _run_command([_perl_version(path), "-c", path]) -perl_syntax.dependencies = {"perl", "perl6"} +perl_syntax.dependencies = {"perl", "rakudo"} def perldoc(path): @@ -457,25 +459,7 @@ perltidy.dependencies = {"perltidy"} def perl6_syntax(path): return _run_command(["perl6", "-c", path]) -perl6_syntax.dependencies = {"perl6"} - - -def _jlint_tool(tool_type, path): - stdout, *rest = _do_command([tool_type, path]) - status = (Status.ok - if "Verification completed: 0 reported messages." in stdout - else Status.problem) - return status, fill3.Text(stdout) - - -def antic(path): - return _jlint_tool("antic", path) -antic.dependencies = {"jlint"} - - -def jlint(path): - return _jlint_tool("jlint", path) -jlint.dependencies = {"jlint"} +perl6_syntax.dependencies = {"rakudo"} def splint(path): @@ -568,7 +552,7 @@ uncrustify.dependencies = {"uncrustify"} def php5_syntax(path): return _run_command(["php", "--syntax-check", path]) -php5_syntax.dependencies = {"php5"} +php5_syntax.dependencies = {"php"} ############################# @@ -704,8 +688,7 @@ def _tools_for_extension(): "pm6": [perl6_syntax, perldoc], "pod": [perldoc], "pod6": [perldoc], - "java": [antic, uncrustify], - "class": [jlint], + "java": [uncrustify], "c": [splint, uncrustify], "h": [splint, uncrustify], "o": [objdump_headers, objdump_disassemble, readelf], diff --git a/tools_test.py b/tools_test.py index 76aeb3f..c015d8f 100755 --- a/tools_test.py +++ b/tools_test.py @@ -13,6 +13,7 @@ import golden import tools +os.environ["TZ"] = "GMT" VIGIL_ROOT = os.path.dirname(__file__) @@ -129,13 +130,6 @@ class ToolsTestCase(unittest.TestCase): self._test_tool(tools.perl6_syntax, [("perl6.p6", tools.Status.problem)]) - def test_antic(self): - self._test_tool(tools.antic, - [("closure-util.java", tools.Status.problem)]) - - def test_jlint(self): - self._test_tool(tools.jlint, [("javaversion.class", tools.Status.ok)]) - def test_uncrustify(self): self._test_tool(tools.uncrustify, [("closure-util.java", tools.Status.problem),