Skip to content

fix: say when slint init writes a config that shadows an inherited one - #354

Merged
MaximeGaudin merged 2 commits into
mainfrom
fix/issue-40-init-parent-config
Aug 29, 2026
Merged

fix: say when slint init writes a config that shadows an inherited one#354
MaximeGaudin merged 2 commits into
mainfrom
fix/issue-40-init-parent-config

Conversation

@MaximeGaudin

Copy link
Copy Markdown
Owner

Summary

  • slint init in a subdirectory checked only ./slint.toml, so it happily wrote a config that shadows an inherited parent config for everything linted below — with no sign.
  • init now runs the same walk-up lookup the linter uses at run time; when a config already governs the directory, it names that file and says writing here will shadow it. The file is still written (init's job is to write); the warning is the news.
  • The current directory is canonicalised before the walk-up, because Path::new(".").parent() is the empty path, which makes the relative walk stop one level short.

Fixes #40

Test plan

  • New e2e test failed before the fix (no warning) and passes after
  • The test also asserts the no-parent case stays quiet, and the file is still written with exit 0
  • Local checks mirror CI and passed before push (./scripts/check.sh --no-js)
  • CI green on the PR

@MaximeGaudin
MaximeGaudin merged commit 913535f into main Aug 29, 2026
8 checks passed
@MaximeGaudin
MaximeGaudin deleted the fix/issue-40-init-parent-config branch August 29, 2026 08:17
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.

config: slint init does not check for an already-inherited parent config, so it silently writes a shadowing config in a subdirectory

1 participant