fsprojects / FSharp.Data

F# Data: Library for Data Access
https://fsprojects.github.io/FSharp.Data
Other
816 stars 288 forks source link

Hide test artifacts from GitHub's file indexer #1380

Closed rdipardo closed 3 years ago

rdipardo commented 3 years ago

GitHub's web UI is listing HTML as this project's primary source language:

index

You can locally replicate the file stats by running the github-linguist gem inside the working tree:

$ github-linguist
86.38%  HTML
13.44%  F#
0.17%   C#
0.00%   Dockerfile
0.00%   Batchfile
0.00%   Shell

Passing the --breakdown option reveals individual file paths:

$ github-linguist  --breakdown

[..omitted..]

HTML:
tests/FSharp.Data.Tests/Data/EmptyDefinitionLists.html
tests/FSharp.Data.Tests/Data/MarketDepth.htm
tests/FSharp.Data.Tests/Data/NuGet.html
tests/FSharp.Data.Tests/Data/SimpleHtmlLists.html
tests/FSharp.Data.Tests/Data/SimpleHtmlTablesWithThead.html
tests/FSharp.Data.Tests/Data/SimpleHtmlTablesWithTr.html
tests/FSharp.Data.Tests/Data/UKDepartures.html
tests/FSharp.Data.Tests/Data/UKLiveProgress.html
tests/FSharp.Data.Tests/Data/doctor_who.html
tests/FSharp.Data.Tests/Data/doctor_who2.html
tests/FSharp.Data.Tests/Data/doctor_who3.html
tests/FSharp.Data.Tests/Data/ebay_cars.htm
tests/FSharp.Data.Tests/Data/imdb_chart.htm
tests/FSharp.Data.Tests/Data/list_of_counties_wikipedia.html
tests/FSharp.Data.Tests/Data/rottentomatoes.html
tests/FSharp.Data.Tests/Data/us_presidents_wikipedia.html
tests/FSharp.Data.Tests/Data/w3c_html_tables.html
tests/FSharp.Data.Tests/Data/wimbledon_wikipedia.html
tests/FSharp.Data.Tests/Data/zoopla.html
tests/FSharp.Data.Tests/Data/zoopla2.html

I'm guessing the weighty percentage of HTML depends on SLOC, not file count, since the output omitted above shows a super-majority of F# source files.

As a quick fix, you can add a specialized rule to .gitattributes, for example:

tests/FSharp.Data.Tests/Data/**.htm* -linguist-detectable

Commit the change, then re-check the stats; locally, I get something like:

$ github-linguist
98.69%  F#
1.26%   C#
0.02%   Dockerfile
0.02%   Batchfile
0.01%   Shell

I'm hesitant about making changes to a core configuration file like .gitattributes , so I'll defer the resolution of this issue to someone else, for now.

baronfel commented 3 years ago

Luckily I have no such compunctions :)