Severity: Warning | Category: Linting
Detects lines that end with whitespace characters (spaces or tabs).
DATABASE_URL=postgres://localhost␣
API_KEY=secret␣␣␣
DATABASE_URL=postgres://localhost
API_KEY=secret
$ envcheck lint .env
.env:5: W002: Trailing whitespace on line 5
The fix command automatically removes trailing whitespace:
$ envcheck fix .env
Fixed .env:
- Trimmed trailing whitespace from 3 lines
# .envcheckrc.yaml
rules:
W002:
severity: warning # Can set to info
auto_fix: true
Prevent trailing whitespace in your editor:
{
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
}
set listchars+=trail:·
set list
autocmd BufWritePre * :%s/\s\+$//e