Skip to content

Warn when a tool is defined in multiple configuration files - #110

Open
ZayanKhan-12 wants to merge 1 commit into
Roblox:mainfrom
ZayanKhan-12:warn-on-duplicate-tool-definitions
Open

Warn when a tool is defined in multiple configuration files#110
ZayanKhan-12 wants to merge 1 commit into
Roblox:mainfrom
ZayanKhan-12:warn-on-duplicate-tool-definitions

Conversation

@ZayanKhan-12

Copy link
Copy Markdown

Closes #63

Foreman aggregates foreman.toml files from the current directory up to the filesystem root, plus the user configuration, with the first definition of a tool alias taking precedence (ConfigFile::fill_from). When two files define the same alias differently, the override was completely silent — exactly the footgun described in #63.

fill_from now logs a warning naming the alias, the definition in effect, and the one being ignored:

tool `rojo` is defined in multiple configuration files; using `https://github.com/rojo-rbx/rojo@=7.4.0` (ignoring `https://github.com/rojo-rbx/rojo@=6.2.0`)

Design notes:

  • warn, not error — nested-project configs overriding an outer/user config is existing, presumably intentional behavior; erroring would break that workflow.
  • identical duplicate definitions stay silent (nothing surprising is happening).
  • precedence is unchanged, covered by a new test (duplicate_tool_definitions_keep_the_first_one).

Verification

  • cargo test --locked: all suites pass (48 tests, including the new one)
  • cargo fmt -- --check clean; cargo clippy introduces no new warnings

🤖 Generated with Claude Code

Foreman aggregates foreman.toml files from the current directory up to
the filesystem root plus the user configuration, with the first
definition of a tool taking precedence. When two files define the same
tool alias differently, the override was completely silent and easy to
miss.

Log a warning naming the alias, the definition being used and the one
being ignored. Identical duplicate definitions stay silent. Precedence
is unchanged, covered by a new test.

Closes Roblox#63

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Foreman should warn or error on duplicate tool definitions

1 participant