Merged
Conversation
| format!( | ||
| "Pointless comparison. This comparison does nothing but waste CPU instructions. \ | ||
| "Pointless comparison. This comparison does nothing. Did you mean to assign a value? \ | ||
| Either prepend `assert` or remove it." |
Member
There was a problem hiding this comment.
I think this should now be Otherwise, prepend...
| fn message(&self) -> String { | ||
| format!( | ||
| "Pointless comparison. This comparison does nothing but waste CPU instructions. \ | ||
| "Pointless comparison. This comparison does nothing. Did you mean to assign a value? \ |
Member
There was a problem hiding this comment.
I think I'd suggest removing "This comparison does nothing.", it feels redundant.
Member
|
Thanks @harupy! |
Contributor
PR Check ResultsEcosystemℹ️ ecosystem check detected linter changes. (+67 -67 violations, +0 -0 fixes in 41 projects) apache/airflow (+35 -35 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --select ALL
+ tests/core/test_otel_logger.py:179:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/core/test_otel_logger.py:179:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/core/test_otel_logger.py:198:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/core/test_otel_logger.py:198:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/core/test_otel_logger.py:253:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/core/test_otel_logger.py:253:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/decorators/test_mapped.py:37:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/decorators/test_mapped.py:37:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/decorators/test_mapped.py:38:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/decorators/test_mapped.py:38:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/jobs/test_backfill_job.py:1999:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/jobs/test_backfill_job.py:1999:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/jobs/test_backfill_job.py:2000:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/jobs/test_backfill_job.py:2000:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/jobs/test_backfill_job.py:2001:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/jobs/test_backfill_job.py:2001:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/jobs/test_scheduler_job.py:1906:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/jobs/test_scheduler_job.py:1906:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/jobs/test_scheduler_job.py:3946:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/jobs/test_scheduler_job.py:3946:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/models/test_baseoperator.py:648:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/models/test_baseoperator.py:648:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/models/test_baseoperator.py:656:13: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/models/test_baseoperator.py:656:13: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/models/test_baseoperator.py:658:13: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/models/test_baseoperator.py:658:13: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. ... 44 additional changes omitted for project bokeh/bokeh (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --select ALL
+ tests/unit/bokeh/document/test_callbacks__document.py:314:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/unit/bokeh/document/test_callbacks__document.py:314:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/unit/bokeh/document/test_callbacks__document.py:317:9: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/unit/bokeh/document/test_callbacks__document.py:317:9: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + tests/unit/bokeh/models/test_plots.py:485:13: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - tests/unit/bokeh/models/test_plots.py:485:13: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. demisto/content (+29 -29 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero
+ Packs/AzureSecurityCenter/Integrations/MicrosoftDefenderForCloudEventCollector/MicrosoftDefenderForCloudEventCollector_test.py:188:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/AzureSecurityCenter/Integrations/MicrosoftDefenderForCloudEventCollector/MicrosoftDefenderForCloudEventCollector_test.py:188:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/AzureWAF/Integrations/AzureWAF/AzureWAF_test.py:434:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/AzureWAF/Integrations/AzureWAF/AzureWAF_test.py:434:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/AzureWAF/Integrations/AzureWAF/AzureWAF_test.py:503:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/AzureWAF/Integrations/AzureWAF/AzureWAF_test.py:503:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:157:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:157:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:159:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:159:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:165:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:165:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:166:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:166:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:167:5: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/Base/Scripts/DBotSuggestClassifierMapping/dbot_suggest_classifier_mapping_test.py:167:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/CTIX/Integrations/CTIX/CTIX.py:492:17: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/CTIX/Integrations/CTIX/CTIX.py:492:17: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/CTIX/Integrations/CTIX/CTIX.py:520:17: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. - Packs/CTIX/Integrations/CTIX/CTIX.py:520:17: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. + Packs/CTIX/Integrations/CTIXv3/CTIXv3.py:808:21: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. ... 37 additional changes omitted for project Changes by rule (1 rules affected)
|
harupy
commented
Oct 28, 2023
crates/ruff_linter/src/rules/flake8_bugbear/rules/useless_comparison.rs
Outdated
Show resolved
Hide resolved
799d011 to
5ea0316
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Close #8069
Test Plan
cargo test