facebook / facebook/pyrefly

Feature request: Warn on unrecognized config keys

Open
#3,943 3 comments 0 reactions 1 assignee Claimed by @markselby9 View on GitHub
configuration help wanted
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

I copied some config over from mypy into my `pyproject.toml` and wrote `python_version` instead of the `python-version` that pyrefly expects. The key was silently ignored, so I spent a while confused about why my Python version setting had no effect. A warning would have caught it immediately.

I think this would also make pyrefly more internally consistent: an unknown *error kind* already fails to parse (e.g. `unknown variant 'unreachable-match-case'`), but an unknown *top-level key* is silently dropped. It looks like the top-level config struct doesn't reject unknown fields the way the error-kinds enum does.

I'd suggest a warning rather than a hard error — that catches typos without breaking configs shared across pyrefly versions (e.g. a newer key being read by an older binary).

### Sandbox Link

_No response_

### (Only applicable for extension issues) IDE Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.