idea-php-dotenv-plugin icon indicating copy to clipboard operation
idea-php-dotenv-plugin copied to clipboard

False positive inspection for "trailing whitespace"

Open FeBe95 opened this issue 1 year ago • 0 comments

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

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

Screenshot

grafik

FeBe95 avatar Aug 12 '24 13:08 FeBe95