-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 the Solidity Language #2634
Conversation
There are many data files under the |
How would you recommend excluding those? |
Sorry for the delay. Busy weeks. We can't just exclude them, we have to recognize their language. I downloaded 913 of these files. 660 of them match the same pattern: a file with only numbers. So this looks like some kind of data file but we still need to identify it. Once that's done, we can add it to Linguist with eventually a heuristic rule to distinguish the two languages. Is the |
yes
|
@pchaigno - are you still planning on looking into this one?
Edit: looks like at least some of them are related to circuit board soldering diagrams and http://www.elekterv.hu/eaglers274x/index.html and all end with |
We are keen for it. 👍 |
🎏 flagging this as stale 🎏 |
It looks like I was wrong, few of these files match the language identified by @arfon. If we exclude Solidity files and files related to the circuit board soldering diagrams, we still have many unidentified files. |
😞 I think you're right @pchaigno. Thanks for the followup. @whitj00 - I'm afraid this is a limitation with Linguist right now - if one (and only one) language defines a file extension ( As @pchaigno mentioned, the long-term solution is for us to have an option to run our heuristics and return The only solution that we can consider in the short term is to add |
Ping @whitj00. Any thoughts on my last comment ☝️ ? |
@arfon, I think the last thing you proposed would be quite helpful, and it would also prepare for the day when you do add support for |
As a guy comming from a competitive programming background I can say, that *.sol files are often used to store solutions to tasks. Solutions in general can have any format, so it's not possible to identify all of them. Also from the official Sodility grammar I can claim, that any Solidity file would have |
Solidity: | ||
type: programming | ||
extensions: | ||
- .sol |
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.
According to the discussion in #2634 the extension would have to go until the not-a-language
feature is implemented.
@frangio - I no longer maintain this project but you can now use |
Ah yes. My mistake. I didn't realise that Solidity wasn't defined. |
+1 to @frangio's request |
…rmasks. Includes sample files from storborg/regerberate: https://github.com/storborg/regerberate/tree/ed85bb545109950946af90118b058abf9b0bcd3b/samples/eagle Which is MIT-licensed: https://github.com/storborg/regerberate/blob/master/LICENSE From the looks of it, *.sol files on github mostly fit one of the following categories: 1. Solidity - Ethereum Virtual Machine programming; 2. Eagle (electronics CAD) solder masks; 3. UVa Online Judge problem solutions. This commit attempts to differentiate between the first two, using a simple "signature" of (2) ending in `M02*`, as mentioned by @arfon here: github-linguist#2634 (comment)
…rmasks. Includes sample files from storborg/regerberate: https://github.com/storborg/regerberate/tree/ed85bb545109950946af90118b058abf9b0bcd3b/samples/eagle Which is MIT-licensed: https://github.com/storborg/regerberate/blob/master/LICENSE From the looks of it, *.sol files on github mostly fit one of the following categories: 1. Solidity - Ethereum Virtual Machine programming; 2. Eagle (electronics CAD) solder masks; 3. UVa Online Judge problem solutions. This commit attempts to differentiate between the first two, using a simple "signature" of (2) ending in `M02*`, as mentioned by @arfon here: github-linguist#2634 (comment)
I recently added a solidity file, it was not recognized with the languages and got to know about linguist. I think even though there are a lot of files with the same extension now but then most of them are solidity files so I think we can add it as a language to languages.yml and for other files they can use a .gitignore? as classifying a language helps out a lot. |
Examples in wild: https://github.com/search?q=extension%3Asol+contract&ref=searchresults&type=Code&utf8=✓
Documentation: https://github.com/ethereum/wiki/wiki/Solidity-Tutorial https://github.com/ethereum/wiki/wiki/Solidity-Features