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

Fix documented examples for unnecessary-subscript-reversal #7774

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

charliermarsh
Copy link
Member

Summary

Two of the three listed examples were wrong: one was semantically incorrect, another was correct but not actually within the scope of the rule.

Good motivation for us to start linting documentation examples :)

Closes #7773.

@charliermarsh charliermarsh added the documentation Improvements or additions to documentation label Oct 3, 2023
args: &[Expr],
) {
let Some(first_arg) = args.first() else {
pub(crate) fn unnecessary_subscript_reversal(checker: &mut Checker, call: &ast::ExprCall) {
Copy link
Member Author

Choose a reason for hiding this comment

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

(Unrelated refactor to take ast::ExprCall instead of destructured fields.)

@charliermarsh charliermarsh enabled auto-merge (squash) October 3, 2023 04:18
@charliermarsh charliermarsh merged commit a6ebbf2 into main Oct 3, 2023
15 checks passed
@charliermarsh charliermarsh deleted the charlie/C415 branch October 3, 2023 04:18
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 3, 2023

CodSpeed Performance Report

Merging #7774 will degrade performances by 2.35%

Comparing charlie/C415 (26ee2a2) with main (e129f77)

Summary

❌ 1 regressions
✅ 24 untouched benchmarks

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

Benchmarks breakdown

Benchmark main charlie/C415 Change
linter/default-rules[pydantic/types.py] 38 ms 38.9 ms -2.35%

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C415 doc and/or implementation is broken
1 participant