Skip to content

Feature request: Warn on unrecognized config keys #3943

Description

@sentiasm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    configurationhelp wantedLarger than "good first issue", but still well-defined and ready for someone to pick up
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions