Skip to content

Add support for multi-line keys #29

@abskptnyk

Description

@abskptnyk

What happened?

devcheck parsed a single multi-line key-value pair as multiple keys.

// .env.example
# RSA Private Key (multi-line)
RSA_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA2Z3qX2BTLS5e7aKVIYuwITy2Wv2O3n3LVSbqZPtLhL5I9xZq
qX5UqEVE8UtZ7x3VjK3OzP8E7q2B9p1Yz8c3E4F5g6H7i8J9K0L1m2N3o4P5q6
R7s8T9u0V1w2X3y4Z5a6B7c8D9e0F1g2H3i4J5k6L7m8N9o0P1q2R3s4T5u6
-----END RSA PRIVATE KEY-----"

# Single-line configuration keys
DATABASE_URL="postgresql://user:password@localhost:5432/mydb"
API_KEY="sk_live_1234567890abcdefghijklmnop"
JWT_SECRET="your_jwt_secret_key_here_very_long_string"
AUTH_TOKEN

output:

abhishek@bun ~/a/devcheck (main)> ./devcheck --fix
✅  go is installed
✅  Go 1.26.0 installed (need 1.24.5)
❌  missing keys: qX5UqEVE8UtZ7x3VjK3OzP8E7q2B9p1Yz8c3E4F5g6H7i8J9K0L1m2N3o4P5q6, -----END RSA PRIVATE KEY-----", MIIEpAIBAAKCAQEA2Z3qX2BTLS5e7aKVIYuwITy2Wv2O3n3LVSbqZPtLhL5I9xZq, R7s8T9u0V1w2X3y4Z5a6B7c8D9e0F1g2H3i4J5k6L7m8N9o0P1q2R3s4T5u6
   → add the missing keys to your .env file
────────────────────────────────────────
  2 passed  0 warning  1 failed

What did you expect?

it should, ideally, skip the lines which don't have '='

Steps to reproduce

add a multi-line key-value pair, like for e.g. a RSA key, in .env.example file

devcheck version

devcheck version dev

OS and arch

abhishek@bun ~/a/devcheck (main)> uname -a
Linux bun 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions