JetBrains / JetBrains/idea-php-dotenv-plugin

False positive inspection for "trailing whitespace"

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

Description

## Steps to Reproduce

1. Create a file named `.env`
2. Add `FOO=bar # test` to the file's contents
3. Look at the inspections (e.g. in the "Problems" tab)

## Expected Result

No problems are being reported, since this syntax is completely valid.

## Actual Result

Squiggly line is added and "Line has trailing whitespace" is being reported.

## Sources

Here are some references which should support my claim that:
> this syntax is completely valid

- https://github.com/motdotla/dotenv?tab=readme-ov-file#comments
- https://github.com/vlucas/phpdotenv?tab=readme-ov-file#comments
- https://github.com/bkeepers/dotenv?tab=readme-ov-file#comments
- https://docs.docker.com/compose/environment-variables/variable-interpolation/#env-file-syntax

## Example Code

```env
# This is a comment
SECRET_KEY=YOURSECRETKEYGOESHERE # comment
SECRET_HASH="something-with-a-#-hash"
```

## Screenshot
![grafik](https://github.com/user-attachments/assets/8b90fb08-1dc9-407f-a81f-8c1e2ce030f2)

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.