👌 Replace gitignore-parser with ignore-python and add per-project follow_links#64
Merged
Merged
Conversation
…ks config Agent-Logs-Url: https://github.com/useblocks/sphinx-codelinks/sessions/e9503678-3d44-4fee-9eb5-0d065cf4b5af Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
…and test semantics Agent-Logs-Url: https://github.com/useblocks/sphinx-codelinks/sessions/e9503678-3d44-4fee-9eb5-0d065cf4b5af Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
chrisjsewell
April 24, 2026 12:37
View session
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64 +/- ##
==========================================
+ Coverage 89.80% 90.04% +0.23%
==========================================
Files 29 29
Lines 2560 2621 +61
Branches 300 306 +6
==========================================
+ Hits 2299 2360 +61
Misses 165 165
Partials 96 96 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
chrisjsewell
approved these changes
Apr 24, 2026
ubmarco
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
gitignore-parserwithignore-python(Rustignorecrate bindings) for file discovery.This provides native nested
.gitignoresupport, improved performance,and behavioral parity with ubcode.
Adds per-project
follow_linksconfig.Dependency swap
gitignore-parser>=0.1.11→ignore-python>=0.3.3Source discovery rewrite (
source_discover/source_discover.py)WalkBuilderreplacesPath.rglob()+gitignore_parser.parse_gitignore()+fnmatchOverrideBuilderglobsWalkBuilderraises; oldrglobsilently yielded nothing)Walker filter alignment with ubc_codelinks
The walker configuration now replicates the Rust
ignorecrate'sstandard_filters(gitignore)followed byhidden(false),matching ubcode
behaviour exactly. Since the Python
ignore-pythonbindings don't exposestandard_filters(), we set all six individual filter methods:Previously,
git_globalandgit_excludewere hardcoded toFalseand.ignore/parent ignore support was not configured.New
follow_linksconfigfollow_links: bool = Falseadded toSourceDiscoverConfig, both TypedDicts, CLIdiscovercommand, andsrc_tracedirective passthroughSemantic change: include/exclude
With the
ignorecrate's override system, include whitelists files (overriding gitignore),then exclude removes from that set.
Previously include had absolute priority over both gitignore and exclude.
Shared portable test fixture
Added a shared JSON test fixture (
tests/data/discover_fixtures.json)with 18 test cases covering all discovery behaviours.
The same fixture is consumed by both this project and
ubc_codelinksto verify matching behaviour across the Python and Rust implementations.
Test cases cover:
.gitignore(root-level and nested).ignorefile supportincludeandexcludepatterns (individually and combined)src_diredge caseDocumentation updates
configuration.rst: Addedfollow_linksoption docs, expandedgitignoresection to list all supported ignore sources (nested.gitignore,.ignore,.git/info/exclude, global gitignore, parent ignore files), removed "Nested .gitignore is NOT supported" limitation note, correctedinclude/excludepriority descriptiondiscover.rst: Addedfollow_linksto advanced filtering exampleroadmap.rst: Marked nested.gitignoresupport as completed