From 3a9b4ce3615b82d6ea99df97f3d08d0d35d23209 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 3 Sep 2019 21:15:06 +1000 Subject: [PATCH] tools: Add color to perldoc. - Also showing stdout and stderr in any case. --- eris/tools.py | 8 --- eris/tools.toml | 8 +++ .../golden-files/results/perldoc-contents_pod | 71 ++++++++++--------- tests/golden-files/results/perldoc-perl_pl | 3 +- 4 files changed, 46 insertions(+), 44 deletions(-) diff --git a/eris/tools.py b/eris/tools.py index 973fddf..9395451 100644 --- a/eris/tools.py +++ b/eris/tools.py @@ -387,14 +387,6 @@ def python_mccabe(path): # Status.not_applicable) -@deps(deps={"perl-doc"}, url="http://perldoc.perl.org/", - executables={"perldoc"}) -def perldoc(path): - stdout, stderr, returncode = _do_command(["perldoc", "-t", path]) - return ((Status.normal, stdout) if returncode == 0 - else (Status.not_applicable, stderr)) - - @deps(deps={"perltidy"}, url="http://perltidy.sourceforge.net/", executables={"perltidy"}) def perltidy(path): diff --git a/eris/tools.toml b/eris/tools.toml index c66a1eb..eec74b2 100644 --- a/eris/tools.toml +++ b/eris/tools.toml @@ -96,6 +96,14 @@ tools_for_extensions = [ command = "perl6 -c" has_color = true +[perldoc] + dependencies = ["perl-doc"] + url = "http://perldoc.perl.org/" + command = "perldoc -oterm" + success_status = "normal" + error_status = "not_applicable" + has_color = true + [git_blame] dependencies = ["git"] url = "https://git-scm.com/docs/git-blame" diff --git a/tests/golden-files/results/perldoc-contents_pod b/tests/golden-files/results/perldoc-contents_pod index 2513864..c9a8c12 100644 --- a/tests/golden-files/results/perldoc-contents_pod +++ b/tests/golden-files/results/perldoc-contents_pod @@ -1,61 +1,61 @@ -Net::Z3950::AsyncZ - Intro +Net::Z3950::AsyncZ + Intro Net::Z3950::AsyncZ adds an additional layer of asynchronous support for - the Z3950 module through the use of multiple forked processes. I hope - that users will also find that it provides a convenient front end to - "Net::Z3950". My initial idea was to write something that would provide - a convenient means of processing and formatting Z39.50 records--which I - did, using the "Z3950" synchronous code. But I also wanted something - that could handle queries to large numbers of servers at one session. - Working on this part of my project, I found that I had trouble with the - "Z3950" asynchronous features and so ended up with what I have here. + the Z3950 module through the use of multiple forked processes. I hope that + users will also find that it provides a convenient front end to + "Net::Z3950". My initial idea was to write something that would provide a + convenient means of processing and formatting Z39.50 records--which I did, + using the "Z3950" synchronous code. But I also wanted something that could + handle queries to large numbers of servers at one session. Working on this + part of my project, I found that I had trouble with the "Z3950" + asynchronous features and so ended up with what I have here. - I give a more detailed account in in the DESCRIPTION section of + I give a more detailed account in in the DESCRIPTION section of "AsyncZ.pod". - Documentation + Documentation AsyncZ.pod - This is the starting point--it gives an overview of the AsyncZ - module, describes the basic mechanics of its asynchronous workings, - and details the particulars of the objects and methods. But see - ""Examples.pod" for detailed explanations of the sample scripts - which come with the "Net::Z3950::AsyncZ" distribution. + This is the starting point--it gives an overview of the AsyncZ module, + describes the basic mechanics of its asynchronous workings, and + details the particulars of the objects and methods. But see + ""Examples.pod" for detailed explanations of the sample scripts which + come with the "Net::Z3950::AsyncZ" distribution. Options.pod This document details the various options that can be set to modify the behavior of AsyncZ Index Report.pod - Report.pod deals with how records are treated line by line and how - you can affect the apearance of a record's line by line output + Report.pod deals with how records are treated line by line and how you + can affect the apearance of a record's line by line output Examples.pod This document goes through the sample scripts that come with the - "Net::Z3950::AsyncZ" distribution and annotates them in a - line-by-line fashion. It's a basic HOW-TO. + "Net::Z3950::AsyncZ" distribution and annotates them in a line-by-line + fashion. It's a basic HOW-TO. - The Modules - There are more modules than there is documentation. The reason for this - is that the only module you have full and complete access to is + The Modules + There are more modules than there is documentation. The reason for this is + that the only module you have full and complete access to is "Net::Z3950::AsyncZ". The other modules are either internal to "Net::AsyncZ" or accessed indirectly or in part indirectly. Here are the modules: Net::Z3950::AsyncZ - The main module: direct access --documented in "AsyncZ" and - "Options" documentation + The main module: direct access --documented in "AsyncZ" and "Options" + documentation Net::Z3950::AsyncZ::ErrMsg - User error message handling: indirect access -- documented in - "AsyncZ" documentation + User error message handling: indirect access -- documented in "AsyncZ" + documentation Net::Z3950::AsyncZ::Errors - Error handling for debugging: limited access -- documented in - "AsyncZ" documentation + Error handling for debugging: limited access -- documented in "AsyncZ" + documentation Net::Z3950::AsyncZ::Report - Module reponsible for fetching and formatting records: limited - access -- documented + Module reponsible for fetching and formatting records: limited access + -- documented Net::Z3950::AsyncZ::ZLoop Event loop for child processes: no access -- not documented @@ -64,7 +64,8 @@ Net::Z3950::AsyncZ Connection details for child processes: no access -- not documented Net::Z3950::AsyncZ::Options::_params - Options for child processes: direct and indirect access -- - documented in "Options" and "AsyncZ" documentation + Options for child processes: direct and indirect access -- documented + in "Options" and "AsyncZ" documentation -INDEX +INDEX + \ No newline at end of file diff --git a/tests/golden-files/results/perldoc-perl_pl b/tests/golden-files/results/perldoc-perl_pl index 6d0458d..518dc2e 100644 --- a/tests/golden-files/results/perldoc-perl_pl +++ b/tests/golden-files/results/perldoc-perl_pl @@ -1 +1,2 @@ -No documentation found for "./input/perl.pl". +No documentation found for "./input/perl.pl". + \ No newline at end of file