Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

red-knot: Change resolve_global_symbol to take Module as an argument #11723

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

MichaReiser
Copy link
Member

Summary

This PR changes the signature of resolve_global_symbol to accept a Module instead of a ModuleName to avoid that we go through module.name(db) -> resolve_module(db, name) when we areadly have a module.

Test Plan

cargo test

@MichaReiser MichaReiser requested a review from carljm as a code owner June 3, 2024 15:20
@MichaReiser MichaReiser added the red-knot Multi-file analysis & type inference label Jun 3, 2024
Copy link
Contributor

github-actions bot commented Jun 3, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Makes sense, looks good!

@MichaReiser MichaReiser force-pushed the resolve-global-symbol-accept-module branch from 18afec8 to 7e5cf0b Compare June 4, 2024 06:15
@MichaReiser MichaReiser force-pushed the resolve-global-symbol-accept-module branch from 7e5cf0b to b1fcabc Compare June 4, 2024 06:17
@MichaReiser MichaReiser enabled auto-merge (squash) June 4, 2024 06:17
@MichaReiser MichaReiser merged commit 6ffb961 into main Jun 4, 2024
15 checks passed
@MichaReiser MichaReiser deleted the resolve-global-symbol-accept-module branch June 4, 2024 06:20
Copy link

codspeed-hq bot commented Jun 4, 2024

CodSpeed Performance Report

Merging #11723 will degrade performances by 12.14%

Comparing resolve-global-symbol-accept-module (b1fcabc) with main (64165be)

Summary

❌ 1 regressions
✅ 29 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main resolve-global-symbol-accept-module Change
linter/all-with-preview-rules[numpy/globals.py] 801.2 µs 911.9 µs -12.14%

carljm added a commit that referenced this pull request Jun 4, 2024
* main:
  CI: add job to run tests under minimum supported rust version (msrv) (#11737)
  Lexer should consider BOM for the start offset (#11732)
  Use cursor offset for lexer checkpoint (#11734)
  red-knot: Change `resolve_global_symbol` to take `Module` as an argument (#11723)
  red-knot: Use `parse_unchecked` to get all parse errors (#11725)
  Respect per-file ignores for blanket and redirected noqa rules (#11728)
  [`pygrep_hooks`] Check blanket ignores via file-level pragmas (`PGH004`) (#11540)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants