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

loc returns a count of 0 for files without an extension #68

Closed
wbthomason opened this issue Dec 14, 2017 · 2 comments
Closed

loc returns a count of 0 for files without an extension #68

wbthomason opened this issue Dec 14, 2017 · 2 comments

Comments

@wbthomason
Copy link

This may be by design, but:

Write the following to a file named e.g. foo.py:

#!/bin/python

hello = "Count me!"

Run loc foo.py. You'll get the expected result, 1 line of Python. Now run mv foo.py foo and run loc foo. The result shows 0 lines of anything.

This may be out of scope for loc (detecting filetypes without an extension can be hard), but it does mess up counts for codebases with scripts named without extensions, e.g. run_task, etc.

What would be required for loc to return counts for files without extensions?

@dicktyr
Copy link

dicktyr commented Feb 2, 2018

indeed, this certainly limits loc's utility
so please at least include an option to read shebang files

@cgag
Copy link
Owner

cgag commented Aug 23, 2018

i added some basic shebang checking, it's not much but it should cover the case in this issue

@cgag cgag closed this as completed Aug 23, 2018
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

3 participants