linguist
linguist copied to clipboard
Allow ssh and sshconfig tags for ssh config syntax highlighting.
Describe the enhancement
Support ```sshconfig
, ```ssh
, and ```ssh-config
tags for sshconfig highlight blocks.
Support in the Wild
At the time of the previous issue discussion ssh config (https://github.com/github-linguist/linguist/issues/3450), the Include
directive for ssh config was not well known, nor widely adopted.
However, now it is supported in macOS, Ubuntu, and many other Linuxes (anything with OpenSSH 8.x or higher): https://man.openbsd.org/ssh_config.5
Although the Include
directive does not specify which extension should be used, .ssh
and .sshconfig
seem to be the common extensions, when one is used. vim
also names its syntax highlighting sshconfig
.
Specifically, .ssh-config
is NOT a common extention and ssh-config
is not a common name for the syntax - at least not as far as I can tell.
As can be seen in https://github.com/github-linguist/linguist/issues/3450#issuecomment-566368051, currently only ```ssh-config
is supported by GitHub.
Recommendations
I'm recommending that sshconfig
, in particular, be added for syntax highlighting as it seems to be the de facto naming convention.
I'd also recommend ssh
because it's the most intuitive - and I highly, highly doubt that there will be some sort of OpenSSH DSL script that would need the ssh
tag in the future. That said, I do understand that, categorically, ssh
might feel wrong as it would seem to describe an ssh DSL rather than a config format. However, since the layperson would reasonably assume that ssh
is the syntax and probably isn't aware that sshconfig
is the de facto name for the syntax.
On another note, I would argue against ssh_config
as the tag as that seems to defy the tag convention, and refers specifically to the file naming convention used for substituting the /
in ~/.ssh/config
and the suggested system-wide configuration file name /etc/ssh/ssh_config
, not the syntax itself.