Skip to content

Move the Rust glob matcher and gitignore handling into submodules - #2707

Open
somewhatabstract wants to merge 4 commits into
mainfrom
claude/jolly-galileo-72zesp-glob-gitignore-modules
Open

somewhatabstract wants to merge 4 commits into
mainfrom
claude/jolly-galileo-72zesp-glob-gitignore-modules

Conversation

@somewhatabstract

Copy link
Copy Markdown
Owner

This groups the clean-room glob matcher and gitignore handling into two submodules of checksync-core. That way they're already shaped like separate crates, ready to be split out later. They follow the existing errors.rs and errors/ pattern. Behaviour doesn't change: this only moves and renames.

  • glob: the matcher files, with their own glob/types.rs. The module uses nothing else from the crate. It exposes only compile_glob, compiled_glob_matches, GlobOptions, CompiledGlob and bytes_before_nul.
  • gitignore: pattern parsing, matching, IgnoreFile, and gitignore/types.rs. The module path replaces the old gitignore_ prefixes. It uses glob only through what glob.rs exposes. IgnoreFile is still re-exported as checksync_core::IgnoreFile.

To lift gitignore out as its own crate later, IgnoreDecision and the path helpers it uses (node_relative, node_normalize, and normalize_separators on Windows) would need to move with it or into a shared crate. glob could be lifted out as it is.

The clean-room agent that wrote both made the move, so the code stays its own work. Part of #2615.

Test plan

  • Every existing test passes unchanged, including the glob vectors and ignore-vectors.json.

Generated by Claude Code

Put the glob matcher in a `glob` module and the gitignore handling,
including IgnoreFile, in a `gitignore` module, each with its own types,
so either could later become a crate of its own. `glob` depends on
nothing else in the crate and exposes only what `gitignore` uses. The
gitignore files and functions drop their `gitignore_` prefix, now that
the module names them. Nothing changes behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2131c61) to head (69cbdb4).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #2707   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          111       112    +1     
  Lines         3830      3843   +13     
  Branches      3038      3051   +13     
=========================================
+ Hits          3830      3843   +13     
Flag Coverage Δ
rust 100.00% <100.00%> (ø)
typescript 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/checksync-core/src/gitignore/bytes_before_nul.rs 100.00% <100.00%> (ø)
...crates/checksync-core/src/gitignore/decide_path.rs 100.00% <100.00%> (ø)
...crates/checksync-core/src/gitignore/ignore_file.rs 100.00% <100.00%> (ø)
.../crates/checksync-core/src/gitignore/last_match.rs 100.00% <100.00%> (ø)
rust/crates/checksync-core/src/gitignore/parse.rs 100.00% <100.00%> (ø)
.../crates/checksync-core/src/gitignore/parse_line.rs 100.00% <100.00%> (ø)
...es/checksync-core/src/gitignore/pattern_matches.rs 100.00% <100.00%> (ø)
...ates/checksync-core/src/gitignore/relative_path.rs 100.00% <100.00%> (ø)
...ecksync-core/src/gitignore/trim_trailing_spaces.rs 100.00% <100.00%> (ø)
...tes/checksync-core/src/glob/advance_any_folders.rs 100.00% <100.00%> (ø)
... and 19 more

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2131c61...69cbdb4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 69cbdb4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Give gitignore its own bytes_before_nul so glob no longer exposes it,
move the gitignore glob options to the module root, refer to sibling
files with `super::` paths, and make BracketSet's fields module-private
like CompiledGlob's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
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.

2 participants