-
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 several more Roff extensions #4309
Conversation
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. Covering every in-the-wild extension used by Roff is as daunting as covering every XML-based file format, which is why we seriously need a similarly dedicated strategy.
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.
Thanks @jordemort for the pull request!
I've checked the usage of the new file extensions, and several are well below our current threshold for in-the-wild usage of hundreds of repositories. I'm not too much worried about conflicts with other languages; even if such conflicts arise, Roff looks fairly easy to distinguish from other languages. Nevertheless, I'm not very comfortable accepting some of these file extensions (those below 100 repositories) as they will make it much harder for us to reject other candidates for support in the future: it's difficult to stay credible when rejecting a file extension with 80 repositories if you accepted one with 20 repositories a month ago...
For those extensions, maybe working on a dedicated strategy as @Alhadis suggested would be a better approach. (With a dedicated strategy, we don't need to add new file extensions.)
Alternatively, if you believe their usage will grow over time, I can add them to #4219, and I'll add support for them myself when they reach the threshold.
@@ -4091,14 +4091,22 @@ Roff: | |||
color: "#ecdebe" | |||
extensions: | |||
- ".roff" | |||
- ".0p" |
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.
I counted only 19 users with 19 repositories using this file extension. That's very low considering our usual threshold of hundreds of repositories. That might be less of an issue if we consider .h.0p
instead of .0p
(because it's very unlikely we ever get a conflicting language for that longer extension), but it will only match 13 repositories out of the 19. We will have a hard time rejecting other file extensions if we accept that one.
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.
- ".1" | ||
- ".1in" | ||
- ".1m" | ||
- ".1p" |
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.
This file extension is used in 170 repositories by 153 users. It's a bit low but I'd say it's okay, because Roff looks fairly easy to distinguish from other languages with a heuristic rule, if needed.
- ".1" | ||
- ".1in" | ||
- ".1m" | ||
- ".1p" | ||
- ".1pm" |
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.
This file extension is used by only 11 users with 11 repositories. Again, this is very low.
- ".3in" | ||
- ".3m" | ||
- ".3o" |
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.
This file extension is used by 13 users with 15 repositories.
- ".3in" | ||
- ".3m" | ||
- ".3o" | ||
- ".3p" | ||
- ".3perl" |
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.
This file extension is used by only 19 users (20 repositories), but perhaps it's less likely to conflict with other languages in the future due to the perl
?
|
|
Okay, I need help. Which do you folks prefer for a manpage-strategy?
I'm trying to juggle performance, accuracy, and something that makes sense to Ruby programmers, but I realise trying to uphold all three is going to be impossible. For the record, I'm only concentrating on matching manpages (Roff documents which use |
I'll always be leaning for the less-accurate but clearer solution for heuristics. Ugly code is harder to maintain, and we have to consider the performance impact. |
Actually, that's a large part of why this looks like a mess. 😀 Everything is hard-wired to short-circuit as soon as possible, leaving to a very inside-out looking flow of logic. I think I'll open a W.I.P pull-request so we can discuss this a bit clearer. Just wait until I've finished rewriting the first mess. :D |
This pull request has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this pull request was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions. |
This pull request has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue. |
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.
Nwes Thailand
To go along with github/markup#1196 this PR adds several more extensions to the Roff language.
Description
I surveyed the manpages in the Ubuntu Cosmic, Debian Stretch, and CentOS 7, and in the OpenIndiana Hipster Live DVD. Here are the extensions used, by count, aggregated by unique filename: https://gist.github.com/c69fa7739d6e4731e90d5749c887f29b
I then went and searched for any of the extensions that had more than 100 uses on GitHub - this PR adds the extensions that, as a result of that search:
They went through a further round of winnowing as I was writing up this PR and deciding if I was prepared to defend the addition of each extension.
This ended up excluding a lot of the nonstandard ones from OpenIndiana, which only appear in one or two mirrors on GitHub, along with a lot of assorted exotica. Those will have to wait until @Alhadis adds a shiny new smart Roff strategy.
Checklist:
The new extension is used in hundreds of repositories on GitHub.com
0p
: https://github.com/search?p=1&q=extension%3A0p+NOT+nothack&type=Code1p
: https://github.com/search?p=1&q=extension%3A1p+NOT+nothack&type=Code1pm
: https://github.com/search?q=extension%3A1pm+NOT+nothack&type=Code3G
/3g
: https://github.com/search?p=1&q=extension%3A3G+NOT+nothack&type=Code (used by Apple SDK docs, apparently)3o
: https://github.com/search?p=1&q=extension%3A3o+NOT+nothack&type=Code&utf8=%E2%9C%93 (Common for Ocaml, it seems)3p
: https://github.com/search?q=extension%3A3p+NOT+nothack&type=Code3perl
: https://github.com/search?q=extension%3A3perl+NOT+nothack&type=Code3pm
: https://github.com/search?q=extension%3A3pm+NOT+nothack&type=CodeI have included a real-world usage sample for all extensions added in this PR:
0p
: https://github.com/kitserver/kitserver5/blob/995dfb80cb2a5ca2cd1506ca772f629cc1fe92b6/src/soft/libarchive-2.4.12-1/man/man0p/cpio.h.0p1p
: https://github.com/mirrete/perlblog/blob/5696f2f67ce6e28600988df2d0e1aed74dd92d0f/blib/man1/blog_cgi.pl.1p1pm
: https://github.com/germanleonz/scm_perl/blob/cbc22b52369ed7f0521b700da6778d60961e91d1/lib/share/man/man1p/instmodsh.1pm3G
: https://github.com/hjc4869/osxcross-bin/blob/62c9b301d472f81187dd2611299bfe106ad484a1/SDK/MacOSX10.11.sdk/usr/share/man/man3/glBeginConditionalRender.3G3o
: https://github.com/EnjoyLifeFund/macHighSierra-cellars/blob/49a477d42f081e52f4c5bdd39535156a2df52d09/ocaml/4.05.0/share/man/man3/Ast_helper.Const.3o (Ocaml License https://ocaml.org/docs/license.html LGPL 2.1)3p
: https://github.com/dank101/4.3BSD-Reno/blob/00328b5a67ffe35e67baeba8f7ab75af79f7ae64/share/doc/ucs/spms/pgrep.3p (BSD License)3perl
: https://github.com/jiaojie1989/graphviz-2.38.0/blob/65568018aee8a060c0acbd219d90b9ca3ddcb411/tclpkg/gv/gv.3perl (GraphViz License https://graphviz.org/license/ CPL 1.0)3pm
: https://github.com/part1zano/scripts/blob/2a4392dbce8503ebdd9192dcbe9c8ab78253a468/perl/rfc/usr/Vlad/Crypt-DH-0.06/blib/man3/Crypt::DH.3pmI have included a change to the heuristics to distinguish my language from others using the same extension.