0

I deleted a bunch of .cc files on GitHub, but it stills sees them for the purpose of calculating language stats. So it labels the repo as C++ even though it's all Python.

I read through guide here but didn't find anything about how it handles deleted files. https://github.com/github/linguist#how-linguist-works-on-githubcom

Edit: The reason I thought this happened is that when I click the C++ percentage it shows all the .cc files in the folder where they used to be. But I actually didn't delete them, I just moved them into a folder called generated. After waiting overnight, now it shows the files in the correct location in the generated folder, so it was just a time delay issue.
But now I am not sure why they're still showing. From the Linguist docs, I thought anything inside a generated folder is ignored.

Elliott B
  • 980
  • 9
  • 32
  • What's the URL of the repository? What makes you think they're still taken into account in language statistics? – pchaigno Nov 07 '19 at 09:34

1 Answers1

0

You need to create a .gitattributes file in the root directory of the repo with the following contents:

path/to/folder/with/c++/files/* linguist-vendored

You can add more lines to the file if you want to ignore multiple folders.

Nikolay Shindarov
  • 1,616
  • 2
  • 18
  • 25
  • If they deleted the `.cc` files, the Linguist override you propose shouldn't be necessary. – pchaigno Nov 07 '19 at 09:36
  • @pchaigno OP said they deleted "a bunch of files", not all files. – Nikolay Shindarov Nov 07 '19 at 09:43
  • Yes. They also said `it's all Python`. So even if there are C++ files remaining, they probably don't know where these files are located. I'm just not sure an override is the right fix here; it might make the problem disappear, but it seems unlikely to fix the root cause. – pchaigno Nov 07 '19 at 10:03