Comments (28)
We've talked about this internally and we want to avoid any sort of per repo configuration. Sorry.
from linguist.
I made a workaround to force your repository's main language.
Example:
I want to force my repository to be marked as C# repository:
- Create somefile.cs
- Write this code
using System;
namespace ForceCSharpGitHub
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("This is a C# repository"); //Duplicate this line 500,000 times
}
}
}
Commit it, push, and you will see now that your repository is a C# repository!
from linguist.
@blakev It was released a few weeks ago: README#Overrides.
from linguist.
- 1 for ignoring doc/docs directories
from linguist.
This is a must have in my view. It seems ridiculous that a repo can't configure the way stats are collected when so many contain 3rd party code.
from linguist.
Will this file (.gitattributes
) also be used for github stats? It's always a bit disappointing to see all stat charts destroyed when commiting vendors to the tree. On one repo I have about 935,827 ++ / 849,501 --. I'm not that productive 😄
from linguist.
To anybody still finding the issue through Google like me, Linguist now treats code under certain paths as vendored by default and doesn't include them in the stats.
from linguist.
Since the language statistics come from Github rather than from Git, adding an options section to the web interface would also be a solution to think of. Just a textbox with one folder path per line. Those paths inside the repository would be excluded from the language statistics.
You can't cover all libraries by a global exclude list. What about developers of an excluded library? If they use Github, their whole project would get excluded. In my opinion some kind of repository wide configuration is the way to go.
from linguist.
I would like it if doc
directories were ignored. Min-ed jQuery typically dominates any project I that I use yardoc to publish my docs, and preview.github.io
means I can host those docs online as well, which is a huge advantage.
from linguist.
Any word on this? I have a project done mostly in Ruby. Despite this, Github has determined its a CSS/HTML project, because I wrote documentation and it's included with the project. I should be able to exclude my ./doc folder. Github should hook into this functionailty once it's in Linguist.
from linguist.
I can't see any disadvantage of supporting an optional hint file. Where can we discuss this?
from linguist.
My bin folder contains the documentation for those binaries! It's weighting the statistics entirely toward HTML, a format I don't use at all in the actual project: https://github.com/Kroc/pling (it's all assembly). Could you ignore sub-folders of /bin, or is this cutting off other use-cases?
from linguist.
@Kroc This is all explained in our readme. Please read the section on overrides for the solution to your problem.
from linguist.
Josh, could you make those internal reasons public? I'm failing to see a downside for per repo configuration in this case.
from linguist.
What's the status on this? I don't want my web projects being labeled as CSS.... -_-
from linguist.
Just to note, there is some functionality that already exists to exclude certain files and paths. Just mentioning it in case you weren't aware, since you didn't reference it.
--- README snip ---
Ignore vendored files
Checking other code into your git repo is a common practice. But this often inflates your project's language stats and may even cause your project to be labeled as another language. We are able to identify some of these files and directories and exclude them.
Linguist::FileBlob.new("vendor/plugins/foo.rb").vendored? # => true
See Linguist::BlobHelper#vendored? and lib/linguist/vendor.yml.
Generated file detection
Not all plain text files are true source files. Generated files like minified js and compiled CoffeeScript can be detected and excluded from language stats. As an extra bonus, these files are suppressed in Diffs.
Linguist::FileBlob.new("underscore.min.js").generated? # => true
See Linguist::BlobHelper#generated?.
from linguist.
@josh Why? So this means our repository is broken unless we delete things from it. What about adding more libraries to the list of things to ignore?
from linguist.
What the above asked, basically. Why would you want to actively avoid giving users the ability to configure such things?
from linguist.
I have 3rd party libraries that are written in a different language, but need to be included in the project itself.
True, language statistics aren't the biggest deal, but it would be very nice if I could just exclude the folder itself from being analyzed.
from linguist.
I would love this. I track my js libraries so I can easily deploy to different environments. Right now, I have a python app that is 98% javascript.. a bit misleading.
from linguist.
@danijar @AlbertoMonteiro Look at the current PRs, it's already being developed.
from linguist.
Awesome, thanks for posting the link!
from linguist.
@arcanis It's a good idea I think. It's not something that can be implemented in Linguist however; you should suggest it to GitHub support. Might be a bit more difficult to implement for them though.
from linguist.
Do lines in Linguist vendored files still count towards line additions/deletions?
from linguist.
Do lines in Linguist vendored files still count towards line additions/deletions?
You can easily test this 😉
from linguist.
I include binaries in a '/bin' directory for out-of-the-box build functionality. It seems too obvious that excluding a 'bin' directory has not already been discussed / rejected! Should I file an issue, or is this a won't-fix?
from linguist.
@Kroc It's a won't-fix. Linguist only scans textual formats and doesn't even acknowledge binary files. Moreover, this would severely affect repositories with executable scripts in /bin
directories (which should count towards language statistics).
from linguist.
Updated link to overrides doc: https://github.com/github/linguist/blob/master/docs/overrides.md
from linguist.
Related Issues (20)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linguist.