Skip to content

Fix linguist attribute so HTML test fixtures are excluded from language stats#51

Merged
fivefilters merged 1 commit into
masterfrom
claude/github-composer-test-exclusion-8zlg5k
Jul 21, 2026
Merged

Fix linguist attribute so HTML test fixtures are excluded from language stats#51
fivefilters merged 1 commit into
masterfrom
claude/github-composer-test-exclusion-8zlg5k

Conversation

@fivefilters

@fivefilters fivefilters commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Why

GitHub currently reports this repo as ~99% HTML because of the ~30 MB of HTML test fixtures under test/test-pages/.

.gitattributes already tried to address this with test/* linguist-language=PHP, but that line has never worked: in .gitattributes patterns, * does not cross directory boundaries, so it only matched direct children of test/ (the *Test.php files, which are already PHP) and never the nested fixtures like test/test-pages/lwn-1/source.html. Verified with git check-attr:

$ git check-attr linguist-language -- test/test-pages/lwn-1/source.html
test/test-pages/lwn-1/source.html: linguist-language: unspecified

What

Replace the broken line with:

/test/** linguist-vendored
  • ** matches at any depth, so all fixtures are covered (confirmed via git check-attr on nested files; src/ and root files are unaffected).
  • linguist-vendored excludes 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 in src/.

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-ignore has been in .gitattributes since #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 from test/. Only --prefer-source (full git clone) installs pull the fixtures, which is inherent to git and can't be avoided.

🤖 Generated with Claude Code

…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
fivefilters marked this pull request as ready for review July 21, 2026 18:47
@fivefilters
fivefilters merged commit 574a566 into master Jul 21, 2026
4 checks passed
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