Skip to content
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

Please take into account .gitattributes linguist-language entries, including for unrecognized languages #89

Open
ell1e opened this issue Oct 22, 2023 · 0 comments

Comments

@ell1e
Copy link

ell1e commented Oct 22, 2023

As a new feature, I suggest you support .gitattributes linguist-language entries, including for unrecognized languages. This is already supported by Gitea and means if a repository contains a completely new, and/or very domain-specific niche language, an entry in .gitattributes provided by the repository maintainers will easily make everything "just work". If the tooling plays along of course, which ohcount currently doesn't.

Current output:

$ git init .
Initialized empty Git repository in /home/user/test/.git/
$ echo -e "A\n\nB\nC" > ./test.mylang
$ echo "*.mylang linguist-language=MyLang" > .gitattributes
$ git add test.mylang .gitattributes 
$ git commit -m "Language count test"
[main (root-commit) e716e77] Language count test
 2 files changed, 4 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 test.mylang
$ ohcount .
Examining 2 file(s)

                          Ohloh Line Count Summary                          

Language          Files       Code    Comment  Comment %      Blank      Total
----------------  -----  ---------  ---------  ---------  ---------  ---------
----------------  -----  ---------  ---------  ---------  ---------  ---------
Total                 0          0          0       0.0%          0          0

Expected output:

$ git init .
Initialized empty Git repository in /home/user/test/.git/
$ echo -e "A\n\nB\nC" > ./test.mylang
$ echo "*.mylang linguist-language=MyLang" > .gitattributes
$ git add test.mylang .gitattributes 
$ git commit -m "Language count test"
[main (root-commit) e716e77] Language count test
 2 files changed, 4 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 test.mylang
$ ohcount .
Examining 2 file(s)

                          Ohloh Line Count Summary                          

Language          Files       Code    Comment  Comment %      Blank      Total
----------------  -----  ---------  ---------  ---------  ---------  ---------
MyLang                1          3          0       0.0%          1          4
----------------  -----  ---------  ---------  ---------  ---------  ---------
Total                 1          3          0       0.0%          1          4
@ell1e ell1e changed the title Please respect .gitattributes linguist-language entries, including for unrecognized languages Please take into account .gitattributes linguist-language entries, including for unrecognized languages Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant