Skip to content

test(oxide): cover gitignored source globs#20349

Open
cyphercodes wants to merge 1 commit into
tailwindlabs:mainfrom
cyphercodes:cyphercodes/tailwind-18870-gitignored-source-glob
Open

test(oxide): cover gitignored source globs#20349
cyphercodes wants to merge 1 commit into
tailwindlabs:mainfrom
cyphercodes:cyphercodes/tailwind-18870-gitignored-source-glob

Conversation

@cyphercodes

Copy link
Copy Markdown

Summary

Adds regression coverage for explicit @source deep globs that point inside a gitignored directory.

The test mirrors the storage/app/private/cms_content/**/*.html shape from #18870 and verifies Tailwind scans matching HTML files without scanning non-matching files in the same ignored tree.

Test plan

cargo test -p tailwindcss-oxide it_should_scan_explicit_deep_globs_inside_gitignored_folders -- --nocapture
git diff --check
cargo fmt --check

Refs #18870

@cyphercodes
cyphercodes requested a review from a team as a code owner July 18, 2026 15:28
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2cbc7c49-cf4c-4eb2-b6d5-97cfd2bb49f2

📥 Commits

Reviewing files that changed from the base of the PR and between 094bf62 and 3679f03.

📒 Files selected for processing (1)
  • crates/oxide/tests/scanner.rs

Walkthrough

Adds a regression test for scanning explicit deep globs inside a gitignored folder. The test creates an internal .gitignore, scans for **/*.html, and verifies that only the expected HTML candidate and corresponding scanned file are returned while the JSX file is excluded.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change by describing regression coverage for gitignored source globs.
Description check ✅ Passed The description accurately explains the new regression test and test plan for the gitignored glob case.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

Safe to merge — this is a pure test addition with no changes to production code.

The new test correctly covers the positive case from #18870 and won't break anything. The negative assertion (the .jsx file) is weaker than it appears because it is filtered by extension rather than by gitignore logic, and the content string uses an abbreviated path that deviates from the surrounding convention, but neither issue affects test correctness or production behavior.

Only crates/oxide/tests/scanner.rs changed; the minor inconsistencies are in the new test block around lines 1291–1307.

Reviews (1): Last reviewed commit: "test(oxide): cover gitignored source glo..." | Re-trigger Greptile

Comment on lines +1295 to +1298
(
"storage/app/private/cms_content/some-slug/ignored.jsx",
"content-['SHOULD-NOT-EXIST-IN-OUTPUT']",
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Negative assertion tests extension filtering, not gitignore bypass

ignored.jsx would never appear in candidates regardless of whether the gitignore override is working — the glob pattern **/*.html filters it out on extension alone. If the scanner regresses to ignoring all files in gitignored directories (including HTML ones), this assertion still passes. A stronger negative check would be an .html file that matches the extension but lives outside the explicit @source glob (e.g., storage/app/private/cms_content/some-slug/other.html with a second top-level .gitignore entry covering that tree), so a failing gitignore bypass would cause the positive assertion to fail rather than being masked by extension filtering.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +1291 to +1294
(
"storage/app/private/cms_content/some-slug/0.html",
"content-['cms/some-slug/0.html']",
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The file content string content-['cms/some-slug/0.html'] doesn't echo the actual file path (storage/app/private/cms_content/some-slug/0.html). Every surrounding test uses the full relative path as the content marker (e.g. ("src/foo.html", "content-['src/foo.html']")), so readers expecting that convention may be confused about what path is being asserted.

Suggested change
(
"storage/app/private/cms_content/some-slug/0.html",
"content-['cms/some-slug/0.html']",
),
(
"storage/app/private/cms_content/some-slug/0.html",
"content-['storage/app/private/cms_content/some-slug/0.html']",
),

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

1 participant