<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m" -->

---
title: Your GitHub language bar is lying (how to fix it)
description: GitHub's language bar counts every byte in a repo, including generated docs and vendored test suites. On the chameleon-rs project, that made a mostly-Rust...
canonical: https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Your GitHub language bar is lying (how to fix it) | daily.dev
og:description: GitHub's language bar counts every byte in a repo, including generated docs and vendored test suites. On the chameleon-rs project, that made a mostly-Rust...
og:url: https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m
og:image: https://api.daily.dev/og/posts/tZKD80v7m.png
og:image:alt: Your GitHub language bar is lying (how to fix it)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Your GitHub language bar is lying (how to fix it)

**[Planet Python](https://daily.dev/sources/planetpython)** · 4 min read · 0 upvotes · 0 comments

## Summary

GitHub's language bar counts every byte in a repo, including generated docs and vendored test suites. On the chameleon-rs project, that made a mostly-Rust engine read as '75.5% HTML'. Adding a .gitattributes file with linguist-generated and linguist-vendored lines for the docs and vendored tests brought it to 55.9% Python, 43.3% Rust. Excluding the Python and Rust test and benchmark folders too, since the Python tests at 685 KB outweighed the 420 KB Python package, it should land around 62% Rust and 38% Python, which matches the real project.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://mkennedy.codes/posts/your-github-language-bar-is-lying-and-how-to-fix-it>

## Questions this post answers

### why does GitHub show my repo as mostly HTML when I barely wrote any HTML

GitHub's language bar, powered by Linguist, counts every tracked byte in a repo, including generated documentation output committed to the repo. A generated docs folder of about 9 MB of HTML, JavaScript and CSS made a mostly-Rust project show as 75.5% HTML. Marking that folder with linguist-generated in .gitattributes removes it from the calculation.

_Anyone whose repo stats look wrong can track down the fix with daily.dev before pushing more commits._

### how do I exclude a folder from GitHub's language statistics using .gitattributes

Add a .gitattributes file at the repo root with a path pattern followed by a Linguist attribute: linguist-generated for build output, linguist-vendored for copied-in third-party code, linguist-documentation for docs, or linguist-detectable=false to simply exclude a path from language counting without other effects. You can verify patterns before pushing with 'git check-attr linguist-generated linguist-detectable -- path/to/file'.

_Maintainers cleaning up repo metadata can find the exact gitattributes syntax on daily.dev._

### should my test suite count toward GitHub's language statistics for my project

Probably not, since large test suites can outweigh actual source code and misrepresent a project's primary language. In one Rust/Python project, Python tests were 685 KB versus a 420 KB Python package, versus 950 KB of total Rust, making a mostly-Rust engine look Python-dominated until tests and benchmarks were excluded with linguist-detectable=false.

_Developers deciding how to represent their stack accurately can compare approaches on daily.dev._

## Similar posts on daily.dev

- [Boilerplate Tax - Ranking popular programming languages by density](https://daily.dev/posts/boilerplate-tax---ranking-popular-programming-languages-by-density-g5zeimhjd) · Lobsters · 0 upvotes · 0 comments
- [44% Of GNOME Core Apps Are Written In C, 13% In JavaScript & 10% In Rust](https://daily.dev/posts/44-of-gnome-core-apps-are-written-in-c-13-in-javascript-10-in-rust-brwmz0ttk) · Phoronix · 0 upvotes · 0 comments
- [Lies, Damn Lies, and Github Stars](https://daily.dev/posts/lies-damn-lies-and-github-stars-kjguq2yhe) · RUBYLAND · 1 upvotes · 0 comments

---

Tags: [#open-source](https://daily.dev/tags/open-source), [#github](https://daily.dev/tags/github), [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Your GitHub language bar is lying (how to fix it)","url":"https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m"},"datePublished":"2026-10-30T07:52:29.651Z","dateModified":"2026-10-30T07:53:36.418Z","description":"GitHub's language bar counts every byte in a repo, including generated docs and vendored test suites. On the chameleon-rs project, that made a mostly-Rust...","image":"https://cdn.mkennedy.codes/posts/your-github-language-bar-is-lying-and-how-to-fix-it/social_image.webp","thumbnailUrl":"https://cdn.mkennedy.codes/posts/your-github-language-bar-is-lying-and-how-to-fix-it/social_image.webp","isAccessibleForFree":true,"articleSection":"Planet Python","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet Python","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/eac3cc584cb043b5a242d13752bd3d0c","url":"https://daily.dev/sources/planetpython"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"open-source,github,rust","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet Python","item":"https://daily.dev/sources/planetpython"},{"@type":"ListItem","position":3,"name":"Your GitHub language bar is lying (how to fix it)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/your-github-language-bar-is-lying-how-to-fix-it--tzkd80v7m#faq","mainEntity":[{"@type":"Question","name":"why does GitHub show my repo as mostly HTML when I barely wrote any HTML","acceptedAnswer":{"@type":"Answer","text":"GitHub's language bar, powered by Linguist, counts every tracked byte in a repo, including generated documentation output committed to the repo. A generated docs folder of about 9 MB of HTML, JavaScript and CSS made a mostly-Rust project show as 75.5% HTML. Marking that folder with linguist-generated in .gitattributes removes it from the calculation. Anyone whose repo stats look wrong can track down the fix with daily.dev before pushing more commits."}},{"@type":"Question","name":"how do I exclude a folder from GitHub's language statistics using .gitattributes","acceptedAnswer":{"@type":"Answer","text":"Add a .gitattributes file at the repo root with a path pattern followed by a Linguist attribute: linguist-generated for build output, linguist-vendored for copied-in third-party code, linguist-documentation for docs, or linguist-detectable=false to simply exclude a path from language counting without other effects. You can verify patterns before pushing with 'git check-attr linguist-generated linguist-detectable -- path/to/file'. Maintainers cleaning up repo metadata can find the exact gitattributes syntax on daily.dev."}},{"@type":"Question","name":"should my test suite count toward GitHub's language statistics for my project","acceptedAnswer":{"@type":"Answer","text":"Probably not, since large test suites can outweigh actual source code and misrepresent a project's primary language. In one Rust/Python project, Python tests were 685 KB versus a 420 KB Python package, versus 950 KB of total Rust, making a mostly-Rust engine look Python-dominated until tests and benchmarks were excluded with linguist-detectable=false. Developers deciding how to represent their stack accurately can compare approaches on daily.dev."}}]}
```

