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

Linguist still not acknowledging .pl as Perl scripts also #3230

Closed
ghost opened this issue Sep 18, 2016 · 4 comments
Closed

Linguist still not acknowledging .pl as Perl scripts also #3230

ghost opened this issue Sep 18, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 18, 2016

Perl scripts is not being acknowledged as .pl but when the extension is changed it is then acknowledged as Perl. I don't have any Prolog scripts. What about creating a module that looks into the files to determine the language based on syntax and other certain characteristics that languages have that others don't.
image

@larsbrinkhoff
Copy link
Contributor

Hello @wboswall,

The issue is that you have two files which don't look like typical Perl files. Linguist mistakenly thinks they are Prolog files.

A quick fix for you would be to override the language detection.

@ghost
Copy link
Author

ghost commented Sep 21, 2016

@larsbrinkhoff Thanks for replying but I don't know nor use Prolog. I was reading a perl book when I created the .pl files and I checked and Perl's extension for the script files uses .pl.....Which is really confusing. Don't know why they had an alternate file extension like the other programming languages such as php-it uses php, php5,php7 etc. I tried renaming .pl to .perl but won't compile and rename every time committing from .pl to perl would just suck. So right now it's just really annoying. Other people are saying the same thing such as this person: #435. Hopefully there will be a solution to this bug soon.

@pchaigno
Copy link
Contributor

@wboswall In your case, these files are detected as Prolog because the smiley in these lines matches our heuristic. It's kind of a corner case, so I don't think we should make the regular expression more complicated to fix it (the heuristic will never be perfect anyway).
I would recommend you use the Linguist overrides in this case, as @larsbrinkhoff suggested.

@ghost ghost closed this as completed Sep 22, 2016
@ghost ghost reopened this Sep 22, 2016
@ghost
Copy link
Author

ghost commented Sep 22, 2016

It didn't work. So just hunted up other perl extensions and changed the ones in question with the new extension. Thank you for all of your help @larsbrinkhoff and @pchaigno Much appreciated!!!!!!!:-D
image

@ghost ghost closed this as completed Sep 22, 2016
kensanata added a commit to kensanata/oddmuse that referenced this issue Oct 23, 2017
GitHub uses Linguist to identify source code and .pl files are
sometimes classified as Prolog files. There are various ways to
override this. Using .gitattributes seems to be the easiest.
https://github.com/github/linguist#overrides

Similar issue:
github-linguist/linguist#3230
This issue was closed.
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

2 participants