Skip to content

Apply ignore patterns when the theme root is inside a dot-directory - #1375

Open
diogochaves wants to merge 1 commit into
Shopify:mainfrom
diogochaves:fix/ignore-under-dot-directory
Open

diogochaves wants to merge 1 commit into
Shopify:mainfrom
diogochaves:fix/ignore-under-dot-directory

Conversation

@diogochaves

Copy link
Copy Markdown

What are you adding in this PR?

Fixes #1374

Relative ignore patterns in .theme-check.yml are rewritten to **/<pattern> and matched against the file's absolute URI. minimatch's ** does not cross path segments that start with a dot unless dot: true is set, so when the theme root is under .worktrees/, ~/.cache/ or any other dot-directory, every relative pattern (per-check and global) was silently skipped.

This passes { dot: true } to minimatch in isIgnored. Patterns starting with / were already fine, because the root is substituted literally.

What's next? Any followup issues?

None planned.

Tophatting

  • New specs in ignore.spec.ts with the root at file:/path/.worktrees/theme: per-check and global relative patterns failed before the change and pass after; the root-anchored and no-match cases pass either way.
  • theme-check-node's check() built from this branch, on a real theme copied under a dot-directory: before the change 1 JSONMissingBlock that .theme-check.yml ignores for templates/product.json (126 offenses); after it 0 (125 offenses). The 125 offenses are identical to a run on the same files in a directory without a dot.
  • vitest for theme-check-common and theme-check-node (5829 tests), pnpm type-check and prettier --check pass.

Before you deploy

  • I included a patch bump changeset

Relative ignore patterns become "**/<pattern>" and are matched against
the file's absolute URI. minimatch's "**" does not cross path segments
that start with a dot unless `dot: true` is set, so a theme checked out
under .worktrees/, ~/.cache/ or any other dot-directory had every
relative ignore pattern silently skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@diogochaves
diogochaves requested a review from a team as a code owner October 31, 2026 01:04
@diogochaves

Copy link
Copy Markdown
Author

I have signed the CLA!

This branch has not been deployed

No deployments
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.

Theme Check ignores .theme-check.yml ignore patterns when the theme is inside a dot-directory

1 participant