-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add ".plt" to Prolog extensions #6141
Add ".plt" to Prolog extensions #6141
Conversation
Please update the OP to link to the source of the GNUplot sample and state the license. |
Done |
Why not both? The heuristic will catch the most obvious Prolog cases, and any file not containing a gnuplot> :- set key off
^
invalid command diff --git a/lib/linguist/heuristics.yml b/lib/linguist/heuristics.yml
index d948886c..449de061 100644
--- a/lib/linguist/heuristics.yml
+++ b/lib/linguist/heuristics.yml
@@ -485,6 +485,10 @@ disambiguations:
named_pattern: perl5
- language: Raku
named_pattern: perl6
+- extensions: ['.plt']
+ rules:
+ - language: Prolog
+ pattern: '^\s*:-'
- extensions: ['.plist']
rules:
- language: XML Property List |
Is there anything remaining to be done before this can be merged? |
Yup. You need to fix the failing test 😉 |
@lildude okay hopefully that does it! |
Hi, can this get merged now? I think it's good-to-go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lildude, this LGTM. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Note: this PR will not be merged until close to when the next release is made. See here for more details.
.plt files are used by Gnuplot for saved plots, and by SWI-Prolog (and probably SICSTUS Prolog) for PlUnit tests. Most seem to be misclassified as Gnuplot.
We can try a simple ":-\s?begin_tests" heuristic, but hopefully the classifier will pick up on the vastly different syntax.
I wrote a Prolog .plt sample, and copied an existing Gnuplot sample to have the .plt extension.
Fixes #5074
Checklist:
I am associating a language with a new file extension.
I am fixing a misclassified language