Skip to content

Configuring Alchemist

Alchemist is an extremely flexible tool. Although it runs with sensible defaults, it is highly configurable.

Before diving into specific configuration options, review how configuration works in general below.

Available Configurations

How to Configure Alchemist

The majority of the configuration is done via Alchemist configuration file, however, some options may also be provided via .env file, environment variables and cli flags.

For a list of CLI flags see cli help.

Options available via .env file and environment variables are marked accordingly in this documentation.

The configuration priority is as follows:

  1. cli flags
  2. environment variables
  3. .env file
  4. configuration file

Config File

By default alc_config.yml is used as a configuration file. You can specify a different file using -c flag, e.g. alchemist -c /path/to/config.yml analyze path/to/src.

Specifying Different Values for Different Sources

Many of alchemist configuration options are "localizable" to specific source paths. This means that option may have different values for different sources or even for specific nodes within the parsed source.

Options that are not specified for a given path inherit values from the closest parent path for which such option is defined or use default value.

In case a folder name is the same as an option, use + prefix to disambiguate, e.g. +exclude and not exclude.

Here is an example that specifies a different value for template_tag_filter option for src\exclude and src\subfolder paths:

converter:
  src:
    +exclude:
      template_tag_filter:
        exclude:
          - "runtime"
    subfolder:
      template_tag_filter:
        include:
          - "runtime"