Skip to content

Comments

[ty] Ignore possibly-unresolved-reference by default#17934

Merged
MichaReiser merged 3 commits intomainfrom
micha/disable-possibly-unbound-reference
May 8, 2025
Merged

[ty] Ignore possibly-unresolved-reference by default#17934
MichaReiser merged 3 commits intomainfrom
micha/disable-possibly-unbound-reference

Conversation

@MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented May 8, 2025

Summary

Ignore the possibly-unbound-reference rule by default because it is very noisy at the moment.
We may re-enable it by default in the future.

  • mdtests: The rule remains enabled in mdtests and defaults to info severity. The motivation for this is that we want to see how rules interact with each other and that's easiest when all rules are enabled
  • mypy-primer: We use a user-level configuration to re-enable the rule in mypy primer. Again, the idea is that we want to see the full impact of every change.

@carljm do you want to disable all possibly- rules or only possibly-unbound-reference?

Test Plan

Updated mdtests

@MichaReiser MichaReiser added configuration Related to settings and configuration ty Multi-file analysis & type inference labels May 8, 2025
@MichaReiser MichaReiser force-pushed the micha/disable-possibly-unbound-reference branch from caf38c5 to f423cda Compare May 8, 2025 06:13
@MichaReiser MichaReiser closed this May 8, 2025
@MichaReiser MichaReiser reopened this May 8, 2025
@MichaReiser MichaReiser force-pushed the micha/disable-possibly-unbound-reference branch from f423cda to e2fd83c Compare May 8, 2025 06:20
@MichaReiser MichaReiser changed the title [ty] Disable possibly-unbound-reference by default [ty] Ignore possibly-unbound-reference by default May 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2025

mypy_primer results

No ecosystem changes detected ✅

@MichaReiser MichaReiser force-pushed the micha/disable-possibly-unbound-reference branch 2 times, most recently from fccbe46 to 95b924e Compare May 8, 2025 06:26
@MichaReiser MichaReiser changed the title [ty] Ignore possibly-unbound-reference by default [ty] Ignore possibly-unresolved-reference by default May 8, 2025
@MichaReiser MichaReiser force-pushed the micha/disable-possibly-unbound-reference branch 2 times, most recently from 15464d6 to 3706055 Compare May 8, 2025 06:46
@MichaReiser MichaReiser closed this May 8, 2025
@MichaReiser MichaReiser reopened this May 8, 2025
@MichaReiser MichaReiser marked this pull request as ready for review May 8, 2025 06:58
Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@carljm
Copy link
Contributor

carljm commented May 8, 2025

Thank you!

I think we should only disable possibly-unresolved-reference for now. The patterns where this causes a false positive are much less common in e.g. a class or module body; all of the possibly-unbound false positives I've seen are possibly-unresolved-reference.

@MichaReiser MichaReiser force-pushed the micha/disable-possibly-unbound-reference branch from 3706055 to 4a597a8 Compare May 8, 2025 15:36
@MichaReiser MichaReiser merged commit d608eae into main May 8, 2025
35 checks passed
@MichaReiser MichaReiser deleted the micha/disable-possibly-unbound-reference branch May 8, 2025 15:44
dcreager added a commit that referenced this pull request May 8, 2025
* main:
  [ty] Respect the gradual guarantee when reporting errors in resolving MROs (#17962)
  Convert `Message::SyntaxError` to use `Diagnostic` internally (#17784)
  [ty] Support extending `__all__` with a literal tuple or set as well as a literal list (#17948)
  [ty] Make `unused-ignore-comment` disabled by default for now (#17955)
  [ty] Change default severity for `unbound-reference` to `error` (#17936)
  [ty] Ignore `possibly-unresolved-reference` by default (#17934)
  [ty] Default to latest supported python version (#17938)
  [ty] Generate and add rules table (#17953)
  Update the schemastore script to match changes in ty (#17952)
  [ty] Implement `global` handling and `load-before-global-declaration` syntax error (#17637)
dcreager added a commit that referenced this pull request May 8, 2025
* dcreager/default-typevars:
  clean up the diff
  remove trait
  track in type again
  clippy
  Better expansion of default typevars
  specialize_partial
  enum for TypeMapping
  [ty] Respect the gradual guarantee when reporting errors in resolving MROs (#17962)
  Specialize trait
  Convert `Message::SyntaxError` to use `Diagnostic` internally (#17784)
  [ty] Support extending `__all__` with a literal tuple or set as well as a literal list (#17948)
  [ty] Make `unused-ignore-comment` disabled by default for now (#17955)
  [ty] Change default severity for `unbound-reference` to `error` (#17936)
  [ty] Ignore `possibly-unresolved-reference` by default (#17934)
  [ty] Default to latest supported python version (#17938)
  [ty] Generate and add rules table (#17953)
  Update the schemastore script to match changes in ty (#17952)
  [ty] Implement `global` handling and `load-before-global-declaration` syntax error (#17637)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Related to settings and configuration ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants