Skip to main content

Pyright Diagnostics to Pyrefly

Pyright configs set severity policy with report* rules, in pyrightconfig.json, [tool.pyright], and execution environments. Pyrefly expresses the same policy with error kinds, which use different names, so pyrefly init has to translate each rule as it converts the config.

Some Pyright rules are not recognized by pyrefly init and are skipped without a warning. Pyright rules are also frequently broader than Pyrefly kinds, so one Pyright severity is often applied to several Pyrefly error kinds and is not always an exact equivalent. Review the table below to compare Pyright rules and Pyrefly error kinds.

Severity conversion

Pyright valuePyrefly severity
false or "none"ignore
"information" or "hint"info
"warning"warn
true or "error"error

When several Pyright rules map onto the same Pyrefly kind, the highest severity wins.

warning

A converted severity is not proof of exact diagnostic equivalence. One Pyright rule may cover multiple scenarios, and Pyrefly may split those scenarios into several kinds.

Complete upstream Pyright mapping

Pyright diagnosticClosest Pyrefly kind(s)Config migrationFidelityNotes
reportGeneralTypeIssuesNo single Pyrefly kindNot mappedUmbrellaPyright combines many scenarios here; map the actual diagnostics to specific Pyrefly kinds.
reportPropertyTypeMismatchbad-assignment and/or read-onlyManualRelatedNo dedicated property getter/setter consistency rule.
reportFunctionMemberAccessmissing-attributeAutomaticDirect-ish
reportMissingImportsmissing-importAutomaticDirect
reportMissingModuleSourcemissing-source, missing-source-for-stubsAutomaticSplit
reportInvalidTypeForminvalid-annotation, invalid-literal, invalid-type-alias, not-a-typeAutomaticSplitPyrefly uses more specific error kinds.
reportMissingTypeStubsuntyped-importAutomaticDirect-ish
reportImportCyclesNo direct equivalentNot mappedNoneUse architecture tooling or a dedicated import-cycle linter.
reportUnusedImportNo type-checker equivalentNot mappedLintUse Ruff F401 or another linter.
reportUnusedClassNo type-checker equivalentNot mappedLintUse dead-code analysis where needed.
reportUnusedFunctionNo type-checker equivalentNot mappedLintUse dead-code analysis where needed.
reportUnusedVariableNo type-checker equivalentNot mappedLintUse Ruff or another linter.
reportDuplicateImportNo type-checker equivalentNot mappedLintUse Ruff F811 or another linter.
reportWildcardImportFromLibraryNo type-checker equivalentNot mappedLintUse Ruff F403 or another linter.
reportAbstractUsagebad-instantiationAutomaticPartialPyright also covers abstract-method calls; Pyrefly uses the separate abstract-method-call kind for that scenario.
reportArgumentTypebad-argument-type, invalid-argumentAutomaticSplit
reportAssertTypeFailureassert-typeAutomaticDirect
reportAssignmentTypebad-assignment, bad-unpacking, bad-typed-dict-keyAutomaticSplit
reportAttributeAccessIssuemissing-attribute, missing-module-attribute, no-access, read-onlyAutomaticSplit
reportCallIssuemissing-argument, bad-argument-count, unexpected-positional-argument, unexpected-keyword, bad-keyword-argument, no-matching-overload, incompatible-overload-residual, not-callableAutomaticSplitThis is one of the broadest Pyright diagnostics.
reportInconsistentOverloadinconsistent-overload, invalid-overloadAutomaticSplit
reportIndexIssuebad-indexAutomaticPartialSome unsupported indexing operations are reported as unsupported-operation.
reportInvalidTypeArgumentsbad-specializationAutomaticDirect-ish
reportNoOverloadImplementationinvalid-overloadAutomaticDirect
reportOperatorIssueunsupported-operation, invalid-argument, not-callableAutomaticSplit
reportOptionalSubscriptunsupported-operationAutomaticRelated
reportOptionalMemberAccessmissing-attributeAutomaticRelated
reportOptionalCallnot-callableAutomaticRelated
reportOptionalIterablenot-iterableAutomaticDirect-ish
reportOptionalContextManagerbad-context-managerAutomaticDirect-ish
reportOptionalOperandunsupported-operationAutomaticRelated
reportRedeclarationredefinitionAutomaticDirect-ish
reportReturnTypebad-return, invalid-yieldAutomaticSplit
reportTypedDictNotRequiredAccessnot-required-key-accessAutomaticDirect
reportUntypedFunctionDecoratoruntyped-function-decoratorAutomaticDirect
reportUntypedClassDecoratoruntyped-class-decoratorAutomaticDirect
reportUntypedBaseClassunsupported-dynamic-baseManualRelatedThe Pyrefly kind is about dynamically unresolved bases, not every Any-typed base.
reportUntypedNamedTupleNo direct equivalentNot mappedNone
reportPrivateUsageno-accessAutomaticRelatedThe tools differ in what they consider protected or private usage.
reportTypeCommentUsageNo direct equivalentNot mappedNoneUse a linter if the goal is to prohibit legacy type comments.
reportPrivateImportUsageimplicit-reexport and/or no-accessManualRelatedNo one-to-one automatic mapping.
reportConstantRedefinitiontreat-all-caps-as-final = true plus bad-assignmentManualRelatedThis changes inference policy rather than enabling a single diagnostic kind.
reportDeprecateddeprecatedAutomaticDirect
reportIncompatibleMethodOverridebad-overrideAutomaticBroadPyrefly reports some cases under bad-override-param-name.
reportIncompatibleVariableOverridebad-overrideAutomaticBroadPyrefly reports some cases under bad-override-mutable-attribute.
reportInconsistentConstructorNo direct equivalentNot mappedNone
reportOverlappingOverloadinconsistent-overloadManualNo exact 1:1
reportPossiblyUnboundVariableunbound-nameAutomaticDirect-ish
reportMissingSuperCallmissing-super-callManualDirectThe Pyrefly kind exists but is not part of automatic config migration.
reportUninitializedInstanceVariableimplicitly-defined-attributeAutomaticRelatedThe exact initialization analysis differs.
reportInvalidStringEscapeSequenceNo type-checker equivalentNot mappedLintUse Ruff W605 or Python warnings.
reportUnknownParameterTypeimplicit-any-parameterAutomaticDirect-ish
reportUnknownArgumentTypeunknown-argument-typeAutomaticDirect
reportUnknownLambdaTypeimplicit-any-lambdaAutomaticDirect-ish
reportUnknownVariableTypeunknown-variable-typeAutomaticDirect
reportUnknownMemberTypeunknown-attribute-typeAutomaticDirect-ish
reportMissingParameterTypeimplicit-any-parameterAutomaticDirect-ish
reportMissingTypeArgumentimplicit-any-type-argumentAutomaticDirect-ish
reportInvalidTypeVarUseinvalid-type-varAutomaticBroadSome variance-specific cases use invalid-variance or variance-mismatch.
reportCallInDefaultInitializerNo type-checker equivalentNot mappedLintUse Ruff B006 or another linter.
reportUnnecessaryIsInstanceredundant-conditionAutomaticRelated
reportUnnecessaryCastredundant-castAutomaticDirect
reportUnnecessaryComparisonincompatible-comparison, unnecessary-comparisonAutomaticSplit
reportUnnecessaryContainsNo direct equivalentNot mappedNone
reportAssertAlwaysTrueredundant-conditionManualRelatedNo dedicated tuple-assert rule.
reportSelfClsParameterNameNo type-checker equivalentNot mappedLintUse Ruff N804 / N805.
reportImplicitStringConcatenationNo type-checker equivalentNot mappedLintUse Ruff ISC001 or another linter.
reportUndefinedVariableunknown-nameAutomaticDirect
reportUnboundVariableunbound-nameAutomaticDirect
reportUnhashableNo direct equivalentNot mappedNone
reportInvalidStubStatementNo type-checker equivalentNot mappedLintUse Ruff's PYI rules where applicable.
reportIncompleteStubNo direct equivalentNot mappedNone
reportUnsupportedDunderAllbad-dunder-all, unresolvable-dunder-allAutomaticSplit
reportUnusedCallResultunused-call-resultManualDirect-ishThe Pyrefly kind exists but is not part of automatic config migration.
reportUnusedCoroutineunused-coroutineAutomaticDirect
reportUnusedExceptNo direct equivalentNot mappedNone
reportUnusedExpressionNo type-checker equivalentNot mappedLintUse Ruff B018 or another linter.
reportUnnecessaryTypeIgnoreCommentunused-type-ignore and/or unused-ignoreManualDirect-ishSelect the Pyrefly kind based on whether you are checking # type: ignore or tool-specific ignores.
reportMatchNotExhaustivenon-exhaustive-matchAutomaticDirect
reportUnreachableunreachable, unreachable-match-caseAutomaticSplit
reportImplicitOverridemissing-override-decoratorAutomaticDirect

Why reportGeneralTypeIssues has no single mapping

Pyright uses reportGeneralTypeIssues for many checks that are not assigned to a narrower report* rule. Depending on the scenario, Pyrefly might emit:

  • invalid-inheritance;
  • invalid-annotation;
  • bad-raise;
  • not-iterable;
  • bad-context-manager;
  • bad-match;
  • invalid-super-call;
  • another specific error kind.

A global reportGeneralTypeIssues = "none" cannot be translated safely into one Pyrefly suppression. Run the code and decide which concrete Pyrefly kinds, if any, should be disabled.

BasedPyright-only settings

BasedPyright adds rules beyond upstream Pyright. pyrefly init recognizes some of them:

BasedPyright rulePyrefly
reportExplicitAnyexplicit-any
reportImplicitRelativeImportmissing-import
reportIncompatibleUnannotatedOverridebad-override-mutable-attribute

These are a separate compatibility layer; an upstream Pyright config will not contain them.

note

Last reviewed against upstream Pyright configuration documentation and Pyrefly's migration source on 2026-08-08.