Class Shellcheck

java.lang.Object
dev.dimlight.maven.plugin.shellcheck.Shellcheck

public class Shellcheck extends Object
A thin java wrapper over the shellcheck binary for execution.
  • Field Details

    • VERSION

      public static final String VERSION
      The version of shellcheck that is embedded in the plugin jar.
      See Also:
  • Method Details

    • run

      public static Shellcheck.Result run(String runId, Path shellcheckBinary, List<String> args, List<Path> scriptsToCheck, Path capturedStdout, Path capturedStderr) throws IOException, InterruptedException
      Runs the provided shellcheck binary capturing its output and return code.
      Parameters:
      runId - a string label used to mark the output stdout/stderr files for the run.
      shellcheckBinary - the binary for shellcheck
      args - the command line args to be passed to the shellcheck binary
      scriptsToCheck - the list of arguments to shellcheck
      capturedStdout - the path where the captured stdout should be redirected
      capturedStderr - the path where the captured stderr should be redirected
      Returns:
      a result object containing exit code and captured outputs (on file)
      Throws:
      IOException - if something goes bad doing io things (writing files etc...)
      InterruptedException - if the thread gets interrupted while waiting for shellcheck to finish