Configure envcheck behavior using .envcheckrc.yaml.
Place .envcheckrc.yaml in your project root:
# envcheck configuration file
# Rule configuration
rules:
# Ignore specific rules
ignore:
- W001 # Allow empty values
- W003 # Don't care about sorting
# Rule-specific settings
E001:
severity: error
W002:
severity: warning
auto_fix: true
# Fix behavior
fix:
sort_keys: true
trim_whitespace: true
normalize_spacing: true
create_backup: true
# Ignore patterns
ignore:
files:
- ".env.local"
- ".env.*.local"
keys:
- "*_SECRET"
- "FEATURE_FLAG_*"
# Output settings
output:
format: text
color: auto
verbose: false
# Kubernetes settings
kubernetes:
ignore_namespaces:
- kube-system
- monitoring
ignore_resources:
- Event
- Endpoint
# Doctor settings
doctor:
run_all: false
skip_slow: true
A JSON schema is available for IDE autocompletion:
# Download the schema
curl -o .envcheckrc.schema.json \
https://raw.githubusercontent.com/envcheck/envcheck/main/.envcheckrc.schema.json
Add to your VSCode settings:
{
"yaml.schemas": {
"./.envcheckrc.schema.json": [".envcheckrc.yaml"]
}
}
Command-line options take precedence over config file:
# Override config file format
envcheck lint .env --format=json
# Override ignored rules
envcheck lint .env --ignore=W001,W002
# Override quiet setting
envcheck lint .env --verbose
# Disable color output
ENVCHECK_NO_COLOR=1 envcheck lint .env
# Set default format
ENVCHECK_FORMAT=json envcheck lint .env
# Disable backup creation
ENVCHECK_NO_BACKUP=1 envcheck fix .env
Create .envcheckignore to ignore specific files:
# Ignore files
.env.local
.env.*.local
.env.test
# Ignore directories
tests/
fixtures/
project/.envcheckrc.yaml
~/.config/envcheck/config.yaml
.envcheckrc.yaml