Skip to content

Add a .gitattributes file to fix line count of Jupyter notebook #2771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oke-aditya opened this issue Oct 7, 2020 · 5 comments · Fixed by #2772
Closed

Add a .gitattributes file to fix line count of Jupyter notebook #2771

oke-aditya opened this issue Oct 7, 2020 · 5 comments · Fixed by #2772

Comments

@oke-aditya
Copy link
Contributor

🚀 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.

@fmassa
Copy link
Member

fmassa commented Oct 7, 2020

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

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Nov 17, 2020

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

@oke-aditya
Copy link
Contributor Author

oke-aditya commented Nov 17, 2020

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. LInguist is reporting my project as a Jupyter Notebook github-linguist/linguist#3316

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

@fmassa
Copy link
Member

fmassa commented Nov 18, 2020

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

@oke-aditya
Copy link
Contributor Author

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants