Add Octave language with its own language distinct from MATLAB
Description
This PR is adding a distinction between MATLAB and GNU Octave languages, which both use .m files for their code files. Although GNU Octave is often described as the open source MATLAB alternative due to their similarities, the reality is that it is a separate programming language. Most importantly, although MATLAB syntax can be interpreted by GNU Octave, the opposite is not true. Octave syntax includes # for comment lines, and endif, endfor, endfunction, endclassdef etc as block's closing statements, which are explicitly recognized by the Octave interpreter, but cannot be parsed/run in MATLAB. As a result of these differences, GitHub falsely recognizes Octave code as MATLAB and by using MATLAB's syntax highlighting grammar results into mis-displaying code, which is written explicitly for the Octave language.
Besides the mis-highlighted code syntax of files containing Octave code, this is also confusing for users who might consider that code written for Octave may work in MATLAB, since GitHub reports all Octave code as MATLAB. GNU Octave is a community driven open source project, which has been in constant development for more than 30 years now, and with a reasonably large user base across academic and industrial sectors, especially in engineering fields. Thus, there is also an ethical aspect towards our community of developers and users that the Octave language should not be misclassified as another proprietary language by the worlds largest developer platform, GitHub, which gratefully provides free hosting for a myriad of open source projects.
Checklist:
- [x] I am adding a new language.
- [x] The extension of the new language is used in hundreds of repositories on GitHub.com.
- Search results for each extension:
- The following search query:
NOT is:fork path:*.m AND (/^\s*endfor/ OR /^\s*endfunction/ OR /^\s*endclassdef/ OR /^\s*endif/)returns 44.5k files in more than 200 repositories.
- The following search query:
- Search results for each extension:
- [x] I have included a real-world usage sample for all extensions added in this PR:
- Sample source(s): The following files have been included as real-world usage samples
- Sample license(s): All samples are licensed under the GNU GPLv3.
- [x] I have included a syntax highlighting grammar: Octave-language-grammar
- [x] I have added a color
- Hex value:
#2299C4 - Rationale: The color choice is based on the most prominent color of the GNU Octave logo
- Hex value:
- [x] I have updated the heuristics to distinguish my language from others using the same extension.
- [x] The extension of the new language is used in hundreds of repositories on GitHub.com.
Spotted this PR and just wanted to add that, while octave and matlab do indeed share an odd relationship, matlab is not the only language with which github language detection clashes with, particularly when ".m" files are involved, which are also used by objective-c, wolfram mathematica, and mercury-lang as well.
So I would say this is less a case of "making octave distinct from matlab" specifically per se, but more about adding octave as a proper language, and disambiguating octave files among all the above languages that also use the ".m" extension, including matlab (whose syntax is indeed different, despite the many similarities).
E.g. if one searches github for "language:Objective-C octave" (or indeed "language:Objective-C matlab") one will witness this confusion, and that it's not necessarily octave/matlab-exclusive.
@lildude I have made all necessary changes to the best of my understanding of the errors produced from the automated tests. Please, run once again the testing worklfow and give me some guidance about the necessary changes that might still be required. Thank you very much for your help.
@lildude Are there any other changes required before this PR can be merged?
@lildude Are there any other changes required before this PR can be merged?
Yup. See the test failure.