Skip to content

Fix GitHub Linguist language classification to show C# as primary language#7

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-3-2
Closed

Fix GitHub Linguist language classification to show C# as primary language#7
Copilot wants to merge 1 commit intomainfrom
copilot/fix-3-2

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 5, 2025

GitHub was incorrectly classifying this repository as primarily HTML instead of C#. This happened because GitHub Linguist automatically detects .razor files as HTML, even though they contain C# code with Razor syntax.

Changes Made

Updated .gitattributes to configure GitHub Linguist properly:

  • Force Razor files to be classified as C#: Added *.razor linguist-language=C# to ensure the 72 Razor component files are counted as C# instead of HTML
  • Future-proof for CSHTML files: Added *.cshtml linguist-language=C# for any future MVC views
  • Exclude static assets: Added wwwroot/* linguist-vendored to prevent CSS, JS, and other static files from skewing language statistics

Impact

After this change is merged, GitHub's language breakdown will correctly show:

  • C# as the dominant language (from actual C# code and Razor components)
  • HTML/CSS percentages reflecting only true front-end static content
  • Static vendor files in wwwroot/ directories excluded from language stats

This provides an accurate representation of the repository's technology stack for visitors and contributors.

Fixes #3.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@snxethan snxethan closed this Sep 5, 2025
@snxethan snxethan deleted the copilot/fix-3-2 branch September 5, 2025 01:48
Copilot AI restored the copilot/fix-3-2 branch September 5, 2025 01:49
Copilot AI changed the title [WIP] Fix GitHub Linguist misclassifying repo language as HTML instead of C# Fix GitHub Linguist language classification to show C# as primary language Sep 5, 2025
Copilot AI requested a review from snxethan September 5, 2025 01:50
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.

Fix GitHub Linguist misclassifying repo language as HTML instead of C#

2 participants