Vision: Add a .gitattributes file to fix line count of Jupyter notebook

Created on 7 Oct 2020  路  5Comments  路  Source: pytorch/vision

馃殌 Feature

Not exactly a Feature Request.
Jupyter notebooks lead to a lot of line count since GitHub does not render them properly.
Adding new Jupyter notebooks will soon make this library with primary langauge of Jupyter very high.
While this library is in python. This creates a misconception in first sight.

A neat workaround is to have a .gitattributes file as follows. Remove # Where suitable

# Jupyter notebook

# For text count
# *.ipynb  text

# To ignore it use below
# *.ipynb linguist-documentation

This is just a harmless addition. I guess it does not impact library.

enhancement help wanted

Most helpful comment

Adding new Jupyter notebooks will soon make this library with primary langauge of Jupyter very high.
A neat workaround is to have a .gitattributes file as follows. Remove # Where suitable

Even with the PR merged, library is dominated by Jupyter notebook.

Screen Shot 2020-11-17 at 15 50 26

All 5 comments

That sounds like a good addition to me. Can you open a PR adding this?

Adding new Jupyter notebooks will soon make this library with primary langauge of Jupyter very high.
A neat workaround is to have a .gitattributes file as follows. Remove # Where suitable

Even with the PR merged, library is dominated by Jupyter notebook.

Screen Shot 2020-11-17 at 15 50 26

Probably that's because this keeps track of git history.
It actually works and is reduces the line count significantly.

Some issues that might help

  1. https://github.com/github/linguist/issues/3316

Currently the count is text.
We can simple change to the comment I mentioned here

@oke-aditya let's ignore notebooks for this statistic counting, can you send a PR for that?

Sure

Was this page helpful?
0 / 5 - 0 ratings

Related issues

300LiterPropofol picture 300LiterPropofol  路  3Comments

Abolfazl-Mehranian picture Abolfazl-Mehranian  路  3Comments

ibtingzon picture ibtingzon  路  3Comments

IssamLaradji picture IssamLaradji  路  3Comments

xuanqing94 picture xuanqing94  路  3Comments