Skip to content

fix: anchor ignore patterns to the config file's directory - #325

Open
MaximeGaudin wants to merge 2 commits into
mainfrom
fix/issue-25-anchor-ignore
Open

MaximeGaudin wants to merge 2 commits into
mainfrom
fix/issue-25-anchor-ignore

Conversation

@MaximeGaudin

Copy link
Copy Markdown
Owner

Summary

  • ignore = ["fixtures/**"] read like a .gitignore entry but matched nothing: the pattern was compared against the paths as typed on the command line, so only a defensive **/ prefix worked, and nobody had documented that.
  • Patterns are now anchored to the config file's directory, the convention [[plugins]] path already uses: fixtures/** means the fixtures folder beside slint.toml no matter how the path was passed, and a leading **/ (or only that) still reaches everywhere. Matching is done against the resolved path, so relative and absolute invocations behave the same.
  • Documented in the README and the config docs.

Note: this PR, #323 and #324 all extend the same README/config.mdx paragraph; expect small textual conflicts when merging whichever lands second.

Fixes #25

Test plan

  • New e2e test failed before the fix (the folder was linted) and passes after
  • New unit tests cover anchored, leading-slash and **/-prefixed patterns, including a non-canonical invocation path
  • Local checks mirror CI and passed before push (./scripts/check.sh, JS included)
  • CI green on the PR

MaximeGaudin added a commit that referenced this pull request Aug 29, 2026
* test: reproduce #25 — ignore patterns are not anchored to the config file

Anchored, bare-name, leading-slash, negated, user-global-config,
subdirectory-config and --ignore-path cases, all red before the fix.

* fix: anchor ignore patterns to the config file's directory (#25)

Patterns in `ignore` used to be matched as typed, so `fixtures/**` read
like a .gitignore entry and matched nothing. Every pattern is now
anchored to the directory of the file that named it: a pattern with a
`/` is a path from there, a bare name matches at any depth below it,
and a trailing `/**` excludes the named directory itself. `!` negation
keeps winning over the plain patterns, anchored to the same directory.

This makes the user-global config speak for its own tree and gives
--ignore-path files the same rule — patterns in one are relative to
that file's own directory — which supersedes the intent of #325 folded
into #327's Ignore design.

Fixes #25
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: ignore glob patterns are not anchored to the config file's directory, unlike .gitignore and unlike this project's own plugin paths

1 participant