Skip to content

docs(cfn-lang-ext): correct language-extensions precedence order#9042

Merged
bnusunny merged 1 commit into
developfrom
docs/fix-language-extensions-precedence-order
May 22, 2026
Merged

docs(cfn-lang-ext): correct language-extensions precedence order#9042
bnusunny merged 1 commit into
developfrom
docs/fix-language-extensions-precedence-order

Conversation

@bnusunny
Copy link
Copy Markdown
Contributor

Summary

  • The Enabling Language Extensions doc listed precedence as CLI flag > env var > samconfig.toml, but the runtime order is actually CLI flag > samconfig.toml > env var.
  • samconfig.toml is loaded into Click's default_map by configuration_callback (samcli/cli/cli_config_file.py:245), so by the time resolve_language_extensions_enabled runs (samcli/lib/cfn_language_extensions/sam_integration.py:67-69), flag_value is non-None and the env var is never consulted.
  • Reordered the three methods, dropped the misleading word "equivalent", added a note under samconfig explaining why it wins over the env var, and clarified when the env var is actually read.

Test plan

  • Render docs/cfn-language-extensions.md and confirm the section is readable and the order is CLI flag → samconfig.toml → env var.
  • Spot-check by setting language_extensions = true in samconfig.toml and SAM_CLI_ENABLE_LANGUAGE_EXTENSIONS=0 in the env — samconfig should win (LE on).

The activation precedence was documented as CLI > env var > samconfig.toml,
but the actual behavior is CLI > samconfig.toml > env var. samconfig values
are loaded into Click's default_map by configuration_callback, so by the
time resolve_language_extensions_enabled runs, flag_value is already
non-None and the env var is never consulted.

Reorder the methods to match runtime behavior, drop the misleading word
"equivalent", and add brief notes explaining why samconfig outranks the
env var and when the env var is actually read.
@bnusunny bnusunny requested a review from a team as a code owner May 21, 2026 23:35
@bnusunny bnusunny added this pull request to the merge queue May 21, 2026
Merged via the queue into develop with commit 58da8ea May 22, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants