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

[flake8-simplify] Simplify double negatives in SIM103 #11684

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Jun 1, 2024

Summary

Closes: #11685.

@charliermarsh charliermarsh added the fixes Related to suggested fixes for violations label Jun 1, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) June 1, 2024 23:16
@charliermarsh charliermarsh merged commit b36dd1a into main Jun 1, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/inv branch June 1, 2024 23:21
Copy link
Contributor

github-actions bot commented Jun 1, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+8 -8 violations, +0 -0 fixes in 4 projects; 46 projects unchanged)

apache/airflow (+2 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ airflow/providers/microsoft/azure/hooks/cosmos.py:216:9: SIM103 Return the condition `existing_container` directly
- airflow/providers/microsoft/azure/hooks/cosmos.py:216:9: SIM103 Return the condition `not not existing_container` directly
+ airflow/providers/microsoft/azure/hooks/cosmos.py:264:9: SIM103 Return the condition `existing_database` directly
- airflow/providers/microsoft/azure/hooks/cosmos.py:264:9: SIM103 Return the condition `not not existing_database` directly

demisto/content (+4 -4 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- Packs/ARIAPacketIntelligence/Integrations/ARIAPacketIntelligence/ARIAPacketIntelligence.py:778:9: SIM103 Return the condition `not not self._valid(self.rcs)` directly
+ Packs/ARIAPacketIntelligence/Integrations/ARIAPacketIntelligence/ARIAPacketIntelligence.py:778:9: SIM103 Return the condition `self._valid(self.rcs)` directly
+ Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py:540:5: SIM103 Return the condition `1 < n_labels < n_samples` directly
- Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py:540:5: SIM103 Return the condition `not not 1 < n_labels < n_samples` directly
+ Packs/CommonScripts/Scripts/DisableUserWrapper/DisableUserWrapper_test.py:10:5: SIM103 Return the condition `command1.args_lst == command2.args_lst` directly
- Packs/CommonScripts/Scripts/DisableUserWrapper/DisableUserWrapper_test.py:10:5: SIM103 Return the condition `not not command1.args_lst == command2.args_lst` directly
+ Packs/CommonScripts/Scripts/ParseEmailFiles/ParseEmailFiles.py:3150:9: SIM103 Return the condition `isOleFile(self.msg_file_path)` directly
- Packs/CommonScripts/Scripts/ParseEmailFiles/ParseEmailFiles.py:3150:9: SIM103 Return the condition `not not isOleFile(self.msg_file_path)` directly

mlflow/mlflow (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ mlflow/sklearn/utils.py:929:9: SIM103 Return the condition `len(c.__abstractmethods__)` directly
- mlflow/sklearn/utils.py:929:9: SIM103 Return the condition `not not len(c.__abstractmethods__)` directly

zulip/zulip (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- zerver/models/realms.py:995:9: SIM103 Return the condition `not not self.enable_spectator_access` directly
+ zerver/models/realms.py:995:9: SIM103 Return the condition `self.enable_spectator_access` directly

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
SIM103 16 8 8 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIM103 creates double negative
1 participant