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

Refactor NPY201 #12479

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Refactor NPY201 #12479

merged 1 commit into from
Jul 23, 2024

Conversation

AlexWaygood
Copy link
Member

Summary

This PR refactors the NPY201 rule to reduce nesting and indentation in the code. It's just a pure refactor; there's no substantive changes here. I'm opening this because it makes it easier to rework the code slightly in order to address #12476. It's a separate PR because it changes the indentation for a very large range of lines, creating a pretty big diff.

Test Plan

cargo test -p ruff_linter --lib

@AlexWaygood AlexWaygood added the internal An internal refactor or improvement label Jul 23, 2024
@MichaReiser
Copy link
Member

Lol. Exactly the same amount of added and removed lines. I'll take a look tomorrow unless someone else beats me to it

Copy link

codspeed-hq bot commented Jul 23, 2024

CodSpeed Performance Report

Merging #12479 will improve performances by 4.26%

Comparing alex/refactor-numpy (ef0c7b4) with main (3af6ccb)

Summary

⚡ 1 improvements
✅ 32 untouched benchmarks

Benchmarks breakdown

Benchmark main alex/refactor-numpy Change
lexer[numpy/globals.py] 30.4 µs 29.2 µs +4.26%

@AlexWaygood AlexWaygood merged commit c1b292a into main Jul 23, 2024
20 checks passed
@AlexWaygood AlexWaygood deleted the alex/refactor-numpy branch July 23, 2024 17:24
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants