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

Improve B005 documentation to reflect duplicate-character behavior #7601

Merged
merged 1 commit into from Sep 22, 2023

Conversation

charliermarsh
Copy link
Member

Summary

B005 only flags .strip() calls for which the argument includes duplicate characters. This is consistent with bugbear, but isn't explained in the documentation.

@charliermarsh charliermarsh marked this pull request as ready for review September 22, 2023 15:59
@charliermarsh charliermarsh added the documentation Improvements or additions to documentation label Sep 22, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) September 22, 2023 16:04
Comment on lines +32 to +33
/// while the use of duplicate-character strings is very likely to be a
/// mistake.
Copy link
Member

Choose a reason for hiding this comment

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

and at best dead-code...

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 22, 2023

CodSpeed Performance Report

Merging #7601 will degrade performances by 3.15%

Comparing charlie/B005 (471a3d8) with main (9d16e46)

Summary

❌ 1 regressions
✅ 24 untouched benchmarks

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

Benchmarks breakdown

Benchmark main charlie/B005 Change
linter/default-rules[large/dataset.py] 91.1 ms 94.1 ms -3.15%

@charliermarsh charliermarsh merged commit f137819 into main Sep 22, 2023
15 of 16 checks passed
@charliermarsh charliermarsh deleted the charlie/B005 branch September 22, 2023 16:12
@github-actions
Copy link
Contributor

PR Check Results

Ecosystem

ℹ️ ecosystem check detected changes. (+8, -8, 0 error(s))

airflow (+2, -2)

+ airflow/providers/qubole/hooks/qubole.py:87:21: B005 Using `.strip()` with multi-character strings is misleading
- airflow/providers/qubole/hooks/qubole.py:87:21: B005 Using `.strip()` with multi-character strings is misleading the reader
+ scripts/ci/pre_commit/pre_commit_lint_dockerfile.py:57:15: B005 Using `.strip()` with multi-character strings is misleading
- scripts/ci/pre_commit/pre_commit_lint_dockerfile.py:57:15: B005 Using `.strip()` with multi-character strings is misleading the reader

bokeh (+2, -2)

+ src/bokeh/plotting/_graph.py:138:20: B005 Using `.strip()` with multi-character strings is misleading
- src/bokeh/plotting/_graph.py:138:20: B005 Using `.strip()` with multi-character strings is misleading the reader
+ src/bokeh/plotting/_graph.py:138:78: B005 Using `.strip()` with multi-character strings is misleading
- src/bokeh/plotting/_graph.py:138:78: B005 Using `.strip()` with multi-character strings is misleading the reader

content (+4, -4)

+ Packs/Cryptocurrency/Integrations/Cryptocurrency/Cryptocurrency.py:61:41: B005 Using `.strip()` with multi-character strings is misleading
- Packs/Cryptocurrency/Integrations/Cryptocurrency/Cryptocurrency.py:61:41: B005 Using `.strip()` with multi-character strings is misleading the reader
+ Packs/PcapAnalysis/Scripts/PcapMinerV2/PcapMinerV2.py:138:38: B005 Using `.strip()` with multi-character strings is misleading
- Packs/PcapAnalysis/Scripts/PcapMinerV2/PcapMinerV2.py:138:38: B005 Using `.strip()` with multi-character strings is misleading the reader
+ Packs/SimpleDebugger/Scripts/SimpleDebugger/SimpleDebugger.py:260:42: B005 Using `.strip()` with multi-character strings is misleading
- Packs/SimpleDebugger/Scripts/SimpleDebugger/SimpleDebugger.py:260:42: B005 Using `.strip()` with multi-character strings is misleading the reader
+ Packs/URLHaus/Integrations/URLHaus/URLHaus.py:655:37: B005 Using `.strip()` with multi-character strings is misleading
- Packs/URLHaus/Integrations/URLHaus/URLHaus.py:655:37: B005 Using `.strip()` with multi-character strings is misleading the reader

Rules changed: 1
Rule Changes Additions Removals
B005 16 8 8

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.

None yet

2 participants