JetBrains / JetBrains/idea-php-dotenv-plugin

os.environ['value'] support

Open
#137 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
189
Forks
16
PR merge metrics
No merged PRs in 30d

Description

That would be great to extend current syntaxis with standart python dictionary's.

For now we can work with .env vars like this: `os.getenv('value')` or `os.environ.get('value')`.
But `.get()` methods handles KeyError exceptions, so, we can't autocheck .env file correctness.

All we can do is to write smth like that:
```
foo = os.getenv('bar', None)
if foo is None:
raise KeyError('bar')
```
But, this of cource this ruins the code clearness/elegancy.

So, the main idea is to extend support for python dictionary syntaxis, which will looks like that: `os.environ['value']`.
This syntax will throw the exception in case of incorrect .env key.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.