Notification CLI Report Configuration¶
A user can configure which notifications are report. i.e displayed on the console and what is the return code of the Alchemist CLI based on the notifications.
Setting the Exit Code Based on Notifications¶
After command has completed, Alchemist will assess all generated notifications. Unless the config defines that some notifications should be ignored, all notifications are considered and if at least one error notification is raised, Alchemist will exit with code 1.
There are a couple of ways how this behavior can be modified:
- If
treat_warnings_as_errors
is set toTrue
, Alchemist will exit with code 1 if any warning is raised. - Notifications can be ignored based on their code (via
ignore
key) or operation.
Here is a full annotated example of the notification configuration in the alc_config.yml
file related to exit codes:
notifications:
# Treat warnings as errors.
# If set to True, Alchemist will exit with code 1 if any warning is raised.
treat_warnings_as_errors: false # Default: False
# Ignore notifications with these codes.
# Ignored notifications do not affect alchemist exit code and are not printed in CLI report.
ignore: ["P01_000"] # Default: []
# Ignore all parsing notifications.
# Ignored notifications do not affect alchemist exit code and are not printed in CLI report.
parse_ignore_all: false # Default: False
# Ignore all resolving notifications.
# Ignored notifications do not affect alchemist exit code and are not printed in CLI report.
resolve_ignore_all: false # Default: False
# Ignore all transforming notifications.
# Ignored notifications do not affect alchemist exit code and are not printed in CLI report.
transform_ignore_all: false # Default: False
# Ignore all analysis notifications.
# Ignored notifications do not affect alchemist exit code and are not printed in CLI report.
analyze_ignore_all: false # Default: False
# Ignore all conversion notifications.
# Ignored notifications do not affect alchemist exit code and are not printed in CLI report.
convert_ignore_all: false # Default: False
Reporting Notifications to the CLI¶
Alchemist will report (print) notifications to the CLI based on the configuration. By default, Alchemist will report a summary with notification counts as well as all non-ignored non-developer notifications one by one. The following configuration options can be used to modify this behavior:
notifications:
# Report notifications count to the CLI.
# also available via ALC_SHOW_NOTIFICATION_COUNT env var
cli_notification_count_report: true # Default: True
# If you are not interested in the notifications count, you can disable it:
# cli_notification_count_report: false
# Report notifications from the selected level and up with details to the CLI.
# also available via ALC_CLI_REPORT env var
cli_report: INFO # Default: "INFO"
# E.g. to report only errors and warnings:
# cli_report: WARNING
# If you want ignored notifications to still be printed to the CLI.
report_ignored: true # Default: False
# If you want to get developer notifications in the report as well.
# set to true to include developer notifications in the report:
include_dev: true # Default: False