Skip to content

Mark sys.version_info[0] < 3 and similar comparisons as outdated#13175

Merged
charliermarsh merged 1 commit intomainfrom
charlie/sys
Aug 30, 2024
Merged

Mark sys.version_info[0] < 3 and similar comparisons as outdated#13175
charliermarsh merged 1 commit intomainfrom
charlie/sys

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

Closes #12993.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Aug 30, 2024
checker.diagnostics.push(diagnostic);
let reason = match (int.as_u8(), op) {
(Some(2), CmpOp::Eq) => Reason::AlwaysFalse,
(Some(3), CmpOp::Eq) => Reason::AlwaysTrue,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

== 3 is maybe a little dubious, but we were already doing it. (== is the only case we handled before.)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 30, 2024

CodSpeed Performance Report

Merging #13175 will degrade performances by 7.61%

Comparing charlie/sys (b813d91) with main (28ab5f4)

Summary

❌ 1 regressions
✅ 31 untouched benchmarks

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

Benchmarks breakdown

Benchmark main charlie/sys Change
linter/all-rules[numpy/globals.py] 726.4 µs 786.3 µs -7.61%

@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh merged commit ee21fc7 into main Aug 30, 2024
@charliermarsh charliermarsh deleted the charlie/sys branch August 30, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UP036 should identify sys.version_info[0] or other parts

1 participant