Fix linguist attribute so HTML test fixtures are excluded from language stats#51
Merged
Merged
Conversation
…ge stats The previous pattern `test/* linguist-language=PHP` never matched the ~30MB of HTML fixtures because `*` in .gitattributes does not cross directory boundaries, so files like test/test-pages/lwn-1/source.html were still counted as HTML, making GitHub report the repo as ~99% HTML. Replace it with `/test/** linguist-vendored`, which matches the whole test tree at any depth and removes it from language statistics entirely, so the language bar reflects the actual library code in src/. Composer dist installs were already unaffected: `/test/ export-ignore` (present since PR #9 and included in the v4.0.0 release) keeps the test directory out of the archives GitHub generates for Composer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwAk1TWbeydKTSWRfj7FGb
fivefilters
marked this pull request as ready for review
July 21, 2026 18:47
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.
Why
GitHub currently reports this repo as ~99% HTML because of the ~30 MB of HTML test fixtures under
test/test-pages/..gitattributesalready tried to address this withtest/* linguist-language=PHP, but that line has never worked: in.gitattributespatterns,*does not cross directory boundaries, so it only matched direct children oftest/(the*Test.phpfiles, which are already PHP) and never the nested fixtures liketest/test-pages/lwn-1/source.html. Verified withgit check-attr:What
Replace the broken line with:
**matches at any depth, so all fixtures are covered (confirmed viagit check-attron nested files;src/and root files are unaffected).linguist-vendoredexcludes the files from language statistics entirely, which is more honest than relabelling 30 MB of HTML as PHP — the language bar will now reflect the actual library code insrc/.Stats update on the next push to the default branch after merging.
Composer installs (no change needed)
The test directory is already kept out of Composer dist installs:
/test/ export-ignorehas been in.gitattributessince #9 and is included in the v4.0.0 release.git archive HEAD(what GitHub uses to build the zips Composer downloads) produces 24 files with nothing fromtest/. Only--prefer-source(full git clone) installs pull the fixtures, which is inherent to git and can't be avoided.🤖 Generated with Claude Code