-
Notifications
You must be signed in to change notification settings - Fork 76
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
Detect language of file based on shebang #45
Comments
Hey! can I take this up? |
@hemangsk sure, but please describe how you'd do this before you write the code in case any of us have suggestions/modifications - it's much easier for both sides! :) Assigning you 👍 |
@adtac Thanks! Like for string on first line be,
will it be the right approach and can be worked upon? |
Sounds good. |
One more thing to look into is |
sorry for the delay! Here's the approach I've come up for
And get_language_from_hashbang(hashbang)
Shortcomings in this approach which I've figured out till now and I'm working on are,
|
|
Looks neat 👍 And unless my eyes fail me, the |
Add a get_language_from_hashbang function which checks whether hashbang exists in a file and returns the language used in that file. This get_language_from_hashbang() is used in split_by_language() and language_percentage() Fixes coala#45
@hemangsk any news? |
I'll do the second iteration today asap :)
…On Feb 2, 2017 3:56 AM, "Lasse Schuirmann" ***@***.***> wrote:
@hemangsk <https://github.com/hemangsk> any news?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMalytkn0bnisrjlys0q0hRhMb2wmmJRks5rYQaigaJpZM4K3J7b>
.
|
Add a get_language_from_hashbang function which checks whether hashbang exists in a file and returns the language used in that file. This get_language_from_hashbang() is used in split_by_language() and language_percentage() Fixes coala#45
Add a get_language_from_hashbang function which checks whether hashbang exists in a file and returns the language used in that file. This get_language_from_hashbang() is used in split_by_language() and language_percentage() Fixes coala#45
In some project (mainly that specifically target linux platform) a file without extension is commonly found. Mainly they use shebang (
!#/bin/sh
or similiar) to specify language/intrepeter used.AFAIK, coala-quickstart just detect used language based on their extension, so they fail to detect extensionless file. Also, in
.coafile
the file path need to be explicitly stated, because (ex.files = **.sh, image/base/*
).Project example
https://github.com/discourse/discourse_docker, see this folder
The text was updated successfully, but these errors were encountered: