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

Rebol extension changes to languages.yml #1005

Merged
merged 14 commits into from Apr 21, 2014
Merged

Conversation

draegtun
Copy link
Contributor

Historically Rebol used the .r extension which unfortunately clashes with the R Stats programming language :(

For example even the Rebol interpreter repo says it uses 9.7% R instead of Rebol! - https://github.com/rebol/rebol

So 3 changes here…

  1. .reb is now the primary (and official) extension - http://www.rebol.com/article/0540.html

  2. .rebol moved to list of extensions (some code does use it)

  3. .r added back. NB. The majority of Rebol code on Rebol uses this (followed by .r2 & .r3). .r was present in languages.yml previously but was removed for some reason? (looks like here - 5a5d334)

Historically Rebol used the .r extension which unfortunately clashes with the R Stats programming language :(

For example even the Rebol interpreter repo says it uses 9.7% R instead of Rebol! - https://github.com/rebol/rebol

So 3 changes here…

1) .reb is now the primary (and official) extension - http://www.rebol.com/article/0540.html

2) .rebol moved to list of extensions (some code does use it)

3) .r added back.  NB. The majority of Rebol code on Rebol uses this (followed by .r2 & .r3).  .r was present in languages.yml previously but was removed for some reason? (looks like here - github-linguist@5a5d334)
@pchaigno
Copy link
Contributor

Could you add samples for the file extensions you added?

@draegtun
Copy link
Contributor Author

Added sample files with all the Rebol file extensions.

NB. They all display correct syntax highlighting except for .reb sample file. However I do have some examples in my repo where .r doesn't highlight correctly, for eg. https://github.com/draegtun/PrettifyRebol/blob/master/build/GCP-datatypes.r

@qtxie
Copy link

qtxie commented Mar 26, 2014

@pchaigno All Rebol source file MUST have a header. (docs: http://www.rebol.com/docs/core23/rebolcore-5.html#section-2), like this one:
Simplest form

REBOL []

Or this one:
Have more information

REBOL [
    Title:  "Scan Web Sites"
    Date:   2-Feb-2000
    File:   %webscan.r
    Author: "Jane Doer"
    Version: 1.2.3
]

So if the linguist is smart enough (search the header), no matter what extensions Rebol file used, linguist can recognize it, and distinguish it from R language easily.

@pchaigno
Copy link
Contributor

It would be better to have the .r file that isn't recognized as Rebol as a sample.
For the header, I don't think linguist is smart enough :/ (will see once you added the GCP-datatypes file).
However, you can help it by adding some heuristics (using REBOL) in heuristics.rb

@draegtun
Copy link
Contributor Author

Will this be enough @pchaigno ?

@pchaigno
Copy link
Contributor

I tested your branch on two repositories: rebol and one of yours (PrettifyRebol).
Some Rebol files were still detected as R files.
To make it work, I had to change a bit the heuristics and I replaced the Rebol sample files with "real" ones from the two repositories (see my branch).

Do you want to make the changes or should I open a new pull request?

(The Travis build failed on all the last pull requests so don't worry about it.)

@draegtun
Copy link
Contributor Author

I've made the changes you've suggested to my patch to keep everything together (see above).

Many thanks for all your help on this @pchaigno. Fingers crossed this now does the business :)

@qtxie
Copy link

qtxie commented Mar 28, 2014

@pchaigno The project red is also a good test for Rebol. Now it shows the project use 97.1% R, but actually it is not use even one line R !

@earl
Copy link
Contributor

earl commented Mar 28, 2014

May I venture to suggest some more example scripts to better train the classifier:

@pchaigno
Copy link
Contributor

You should regenerate samples.json if you want the new sample files to be used in the statistical classifier.

@draegtun
Copy link
Contributor Author

draegtun commented Apr 2, 2014

@pchaigno Sorry for the delay. I had some issues getting my Ruby env up-to-date to run bundler/rake on linguist repo (in the end I had to start from clean slate). Passes Travis so hopefully this is now all good to go.

@arfon arfon mentioned this pull request Apr 21, 2014
@arfon arfon merged commit a5fa264 into github-linguist:master Apr 21, 2014
@arfon
Copy link
Contributor

arfon commented Apr 21, 2014

Just a quick update. I've merged these changes in here. If there are still some issues with misidentification then perhaps we can add some more samples and even consider a heuristic that picks up on REBOL

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

Successfully merging this pull request may close these issues.

None yet

6 participants