Files
codegraph/.gitattributes
T
Colby MchenryandClaude Opus 5.5 407ec4fba2 chore: keep the kernel's vendored grammars out of GitHub's language stats (#3045)
GitHub reports the repository as 79% C and 18% TypeScript. Nearly all of
that C is the third-party tree-sitter grammars the native kernel compiles
from source (codegraph-kernel/grammars/, 29 files, about 78 MB).

A new .gitattributes marks every file under codegraph-kernel/grammars/
linguist-vendored, so Linguist leaves them out of the language
statistics, and marks the five generated parser.c files
linguist-generated, so pull requests show those collapsed. The
hand-written scanner.c files stay expanded in diffs on purpose: that is
where C gets patched or added (PR 2173, and the open PR 2866), and every
contributor PR is security-reviewed, so such a change must stay visible.
The patterns use /** because an attributes pattern that names a
directory does not reach the files inside it.

Validation: git check-attr over all 1,722 tracked files reports
linguist-vendored set on exactly the 29 files under
codegraph-kernel/grammars/ and linguist-generated set on exactly the
five parser.c files; scanner.c, the headers and the LICENSE files are
vendored only, and everything else, src/index.ts included, has neither.
In a scratch repository the bare directory pattern leaves parser.c
unspecified. Git does not act on linguist attributes and codegraph never
reads .gitattributes, so builds and tests are unaffected.

Raised by PR 2513 (@build8421) and PR 1668 (@kidonng).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 06:14:08 +00:00

10 lines
550 B
Plaintext

# Third-party tree-sitter grammars that the native kernel compiles from source
# (codegraph-kernel/build.rs). Keep all of them out of GitHub's language
# statistics, and collapse only the generated parser.c files in pull-request
# diffs. The hand-written scanner.c files are where C gets patched or added,
# so they stay expanded for review.
# The /** is needed: an attributes pattern that names a directory does not
# reach the files inside it.
codegraph-kernel/grammars/** linguist-vendored
codegraph-kernel/grammars/**/parser.c linguist-generated