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

[pylint] Implement potential-index-error (PLE0643) #9545

Merged
merged 6 commits into from Jan 21, 2024

Conversation

diceroll123
Copy link
Contributor

@diceroll123 diceroll123 commented Jan 16, 2024

Summary

add potential-index-error rule (PLE0643)

See: #970

Test Plan

cargo test

Copy link
Contributor

github-actions bot commented Jan 16, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 1 project error)

sphinx-doc/sphinx (error)

ruff failed
  Cause: Required version `0.1.13` does not match the running version `0.1.14`

Linter (preview)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 1 project error)

sphinx-doc/sphinx (error)

ruff check --no-cache --exit-zero --preview

ruff failed
  Cause: Required version `0.1.13` does not match the running version `0.1.14`

@Skylion007
Copy link

It's quite common to deal with int64 array indices in machine learning and big data applications so I would recommend allow 64bit indices. Seems like the speed difference wouldn't be worth improperly handling these edge cases?

@diceroll123
Copy link
Contributor Author

I'd love to see a way for arbitrary integer comparisons here, but I don't think we'll be able to do that without adding dependencies. I'd love to be proven wrong, but I'd also argue that 64 bits is beyond plenty in this scenario.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks!

@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Jan 21, 2024
@charliermarsh charliermarsh changed the title [pylint] - add potential-index-error rule (PLE0643) [pylint] Implement potential-index-error (PLE0643) Jan 21, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) January 21, 2024 03:54
@diceroll123
Copy link
Contributor Author

Great tweaks!

@charliermarsh charliermarsh merged commit 49a445a into astral-sh:main Jan 21, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants