Configuration
Use a .gluerc file to set defaults and per-target overrides for code generation.
#Supported config files
Glue auto-detects these files next to your input file:
.gluerc(YAML).gluerc.yaml.gluerc.yml.gluerc.json
If no config file is found, Glue uses built-in defaults.
To use a specific config file:
shell
#How the config is structured
global: defaults applied to every generation entry.gen: a list of per-input rules (mode,files) with optional output and overrides.filescan be a single glob string or a list of glob strings.
#JSON schema
Glue ships a JSON schema for config files at glue/assets/config_schema.json. Use it with VS Code's YAML support to get autocomplete and validation in .gluerc.yaml files.
#Example
yaml
#Notes
- Run
glue gento use an auto-discovered config file, orglue gen --config path/to/.gluerc.yamlto use one explicitly. outputsupports{file_name}and{file_ext}placeholders.watermarksupportsfull,short, ornone.global.diagnostics.suppress_warningssuppresses source diagnostics for bothglue checkandglue gen. Currently supported warning codes:constant_case.preserve_generated_identifierskeeps user-provided identifiers exactly as written, such as model names and fields. Glue may still normalize identifiers it synthesizes from values, such as enum variant constants.python.data_model_librarysupportspydantic,dataclasses,attrs, ormsgspec.rust.serde_struct_derivescontrols serde derives and serde attributes on generated Rust structs, enums, union enums, and type alias newtypes.rust.extra_derivesappends additional Rust derive paths by generated shape:structs,enums,unions, ortype_aliases.