6.2.10. ImportExternalAnalysisOutput

Call an external analysis and capture its output

Runs an external tool as a sub-process and parses violations from its stdout/stderr output using one of the configured ExternalAnalysisFormats.

This can be used to include third-party tools (e.g. lint) in the Axivion analysis.

You can copy this rule if you need to run multiple external tools.

Possible Messages

This rule has no predefined messages.

6.2.10.1. Options

capture_stderr_provider

capture_stderr_provider : str | None = None

Provider to capture the shell stderr output of the given analysis tool. If given, the shell stderr output will be captured and matched against the regexes as configured for the provider. This option should be set to same value as the provider option of a rule in the ExternalAnalysisFormats group.
 

capture_stdout_provider

capture_stdout_provider : str | None = None

Provider to capture the shell stdout output of the given analysis tool. If given, the shell stdout output will be captured and matched against the regexes as configured for the provider.

This option should be set to same value as the provider option of a rule in the ExternalAnalysisFormats group.

 

check_returncode

check_returncode : bool = True

Whether to check the return code of the command
 

command

command : str = ''

Command to execute to run the external analysis.
 

cwd

cwd : bauhaus.analysis.config.LayerRelativePath | None = None

Optional execution directory for the command.
 

encoding

encoding : str = 'utf-8'

The encoding of the output of the executed command. See also encoding_error_handler.
 

encoding_error_handler

encoding_error_handler : EncodingErrorHandler = 'IGNORE'

The strategy to handle encoding errors during processing of the output of the executed command.

  • STRICT: abort with on error on encoding errors,
  • IGNORE: ignore encoding errors (accepting data loss),
  • REPLACE: replace problematic code points with a question mark (?).
 

execute_as_shell_command

execute_as_shell_command : bool = False

Execute the given command through a shell. This is useful if the command is a shell builtin or the command is otherwise reliant on shell behaviour.
 

options

options : list[str] = []

Options for the command.
 

prepend_path_prefix

prepend_path_prefix : bauhaus.analysis.config.PlainPath | None = None

An optional prefix that will be prepended to every violation SLoc. This is known as the "basepath" in some contexts.
 

strip_path_prefix

strip_path_prefix : bauhaus.analysis.config.PlainPath | None = None

An optional prefix that will be stripped from every violation SLoc.
 

6.2.10.2. Option Types

These types are used by options listed above:

EncodingErrorHandler

An enumeration.
 
  • STRICT

  • IGNORE

  • REPLACE