**/vendor/** is unconditional and a repository cannot take it back
In a non-PHP repository whose source package is literally named vendor (common in supply-chain / ERP domains, where "vendor" means supplier), the Composer default in DEFAULT_IGNORE_PATTERNS silently removes every file under it from the graph. In one Java codebase that was 630 production files, and queries for any symbol in them answered as if the code did not exist.
The comment next to the pattern says such a package "belongs in that repository's own ignore configuration", but no such mechanism exists:
_load_ignore_patternsonly ever appends to the default list.- A
!line is diverted intokeepand used solely to spare a directory fromNESTED_OUTPUT_DIR_MARKERSdetection; it never removes a default pattern. _should_ignorehas no concept of negation at all — first match wins.
So the default cannot be overridden from a repository by any documented or undocumented route.
Suggested fix, minimal and in the spirit of the existing comment: apply **/vendor/** only when the repository actually is a Composer project, i.e. when composer.json exists at the root. That keeps the pattern doing its job for PHP and stops it eating source everywhere else, with one condition in _load_ignore_patterns and no change to DEFAULT_IGNORE_PATTERNS (so existing tests that assert against the constant stay green).
A repo-level negation syntax would also work but is a larger change: it needs negative patterns threaded through both the loader and _should_ignore.
Source: tirth8205/code-review-graph