Code::TidyAll::Role::RunsCommand(3pm)

Code::TidyAll::Role::RunsCommand3pm

A role for plugins which run external commands

Usage

    package Whatever;
    use Moo;
    with 'Code::TidyAll::Role::RunsCommand';

Version

version 0.84

Overview

This is a a role for plugins which run external commands

Attributes

cmd

The command to run. This is just the executable and should not include additional arguments.

Methods

_run_or_die(@argv)

This method run the plugin's command, combining any values provided to the plugin's "argv" attribute with those passed to the method.

The plugin's "argv" attribute is parsed with the "shellwords" subroutine from Text::ParseWords in order to turn the "argv" string into a list. This ensures that running the command does not spawn an external shell.

The @argv passed to the command comes after the values from "argv" attribute. The assumption is that this will be what passes a file or source string to the external command.

If the command exits with a non-zero status, then this method throws an exception. The error message it throws include the command that was run (with arguments), the exit status, any signal received by the command, and the command's output.

Both "stdout" and "stderr" from the command are combined into a single string returned by the method.

_is_bad_exit_code($code)

This method returns true if the exit code is bad and false otherwise. By default all non-zero codes are bad, but some programs may be expected to exit non-0 when they encounter validation/tidying issues.

Support

Bugs may be submitted at <https://github.com/houseabsolute/perl-code-tidyall/issues>.

Source

The source code repository for Code-TidyAll can be found at <https://github.com/houseabsolute/perl-code-tidyall>.

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Authors

•

Jonathan Swartz <[email protected]>

•

Dave Rolsky <[email protected]>

From libcode-tidyall-perl 0.84~ds-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.