-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
dotenv syntax highlighting support #4873
Comments
As Linguist relies upon community contributions to address such requests, we'd welcome a PR that adds support or attributes the files to an already defined language. |
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions. |
Seems fair to keep this open as dotenv is a common syntax |
We might want to classify these as You can find many real world examples of
Even the usual usage with just |
@smola I think it would be best to keep dotenv separated from shell syntax. The .env files with shell scripts you linked use hashbangs like For reference, the dotenv npm package lists it's syntax rules, except variable expansion which is added using the dotenv-expand package. |
@probablycorey Please, see the description of this PR: #4922 dotenv is not something new from the Node.js world. It's a convention to somewhat standarize a subset of shell script syntax to allow parsing from different languages. As far as I can tell, all dotenv variants (there are many, supporting different syntax) are strict subsets of Bash. So any highlighter supporting Bash scripts should work with all of them. Also, the syntax supported by the Node package you are linking is far more limited than the syntax supported by the Ruby package (https://github.com/bkeepers/dotenv), the PHP package, etc. If we supported npm's dotenv syntax only, it would be broken with Ruby's dotenv syntax. But AFAIK shell syntax will work with all of them. |
Well, actually this syntax from the npm package is not valid Bash: |
@smola Ah got it, didn't realize there are variants from the npm package's implementation. Makes sense to use shell syntax in that case |
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions. |
Bump, not stale, there is an active PR. |
Feature request to add syntax highlighting support for
.env
files. This was discussed in #3717 in 2017, but seems to have been closed without reason.The
.env
syntax is used to define environment variables, and it's very commonly used with Node.js, Docker and probably others.Although
.env
is often used for passwords, it's also commonly used for general config files which are fine to commit. Some repos have a private.env
file and one that is committed - For example Vue and React use.env
and.env.local
. In addition to that, some repos have.env-sample
,.env.example
, or a code block inREADME.md
, to show how private.env
files should look.References:
.env
file extensions it supports.The text was updated successfully, but these errors were encountered: