Project Configuration Options¶
The following table lists the available project configuration options for Alchemist. These options can be set in a YAML configuration file or passed as command-line arguments.
Option Name | Option Description | Default Value | Localizable | Environment Variable |
---|---|---|---|---|
project_name | Name of the project. | alc_project | No | ALC_PROJECT_NAME |
src_non_utf_encoding | Encoding to use for source files with non-UTF encoding.If not set, the default system encoding is tried, followed by auto-detection heuristics.This option accepts any value (1) that Python accepts | None | No | ALC_SOURCE_NON_UTF_ENCODING |
source_dialect_code | Dialect code of the source (used for parsing and analysis). | sas | No | ALC_INPUT_DIALECT |
target_dialect_code | Dialect code of the target (used for conversion). | None | No | ALC_TARGET_DIALECT |
source_root_path | Common root path for all sources, used to determine "stable" relative paths to source files.2 | None | No | ALC_SOURCE_ROOT_PATH |
source_paths | Project source paths. | None | No | ALC_SOURCE_PATHS1 |
output_path | Path to the root of the output directory for all operations. Defaults to current working directory. | Current working directory | No | ALC_OUTPUT_PATH |
report_format | Format to use for report output. If not set, no results are written to disk. | None | No | ALC_FORMAT |
ui_max_code_chunk_length | Maximum length of code chunk to display in UI. | 1000 | No | |
parser | Parser configuration. | Empty | Yes | |
analyzer | Analyzer configuration. | Empty | Yes | |
resolver | Resolver configuration. | Empty | Yes | |
converter | Converter configuration. | Default Converter Config | Yes |
- You can run the following command to get the list of available encodings:
python3 -c "import encodings.aliases; print('\n'.join(sorted(set(encodings.aliases.aliases.values()))))"
Example YAML Configuration File¶
Below is an example YAML configuration file with non-default values:
project_name: my_project
source_dialect_code: sas
target_dialect_code: dbr
source_paths:
- /path/to/source/1
- /path/to/source/2
output_path: /path/to/output
report_format: xlsx
ui_max_code_chunk_length: 500
parser:
... parser config ...
analyzer:
... analyzer config ...
resolver:
... resolver config ...
converter:
... converter config ...
-
Only one source path may be given via environment variable. If you need to pass more than one, pass it to cli command directly, see usage ↩
-
It is highly recommended to explicitly set this value if you are running Alchemist on batches of sources. This way the entire source tree structure may be properly preserved in the analysis results across multiple runs.
If the value is provided in the config, all source paths must be relative to it.
If not provided, Alchemist will try to determine common root using the following logic:
- if all sources are relative to current working directory, the root will be set to it, unless all sources start in
src
directory, in which case the root will be set tosrc
directory. Using singlesrc
directory as Alchemist source is the recommended way to use Alchemist. - if an absolute single path is provided, and it is not relative to the current working dir, it will be used as root (or the path parent folder if it is a file).
- if multiple absolute source paths are provided, some of which are not relative to the current working directory, an attempt to find the closest common parent is made. On *nix systems it may become root (which is not recommended) and on Windows such common root may not exist if sources are on different drives.
- if all sources are relative to current working directory, the root will be set to it, unless all sources start in