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

Mark repeated-isinstance-calls as unsafe on Python 3.10 and later #11622

Merged
merged 1 commit into from
May 30, 2024

Conversation

charliermarsh
Copy link
Member

Summary

Closes #11616.

@charliermarsh charliermarsh added the fixes Related to suggested fixes for violations label May 30, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) May 30, 2024 18:02
@charliermarsh charliermarsh merged commit 685d11a into main May 30, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/x branch May 30, 2024 18:05
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +0 -18 fixes in 1 projects; 49 projects unchanged)

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

+ Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py:196:16: PLR1701 Merge `isinstance` calls: `isinstance(val, dict | list)`
- Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py:196:16: PLR1701 [*] Merge `isinstance` calls: `isinstance(val, dict | list)`
+ Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector.py:33:12: PLR1701 Merge `isinstance` calls: `isinstance(obj, date | datetime)`
- Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector.py:33:12: PLR1701 [*] Merge `isinstance` calls: `isinstance(obj, date | datetime)`
+ Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:187:23: PLR1701 Merge `isinstance` calls: `isinstance(x, bool | str)`
- Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:187:23: PLR1701 [*] Merge `isinstance` calls: `isinstance(x, bool | str)`
+ Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:192:37: PLR1701 Merge `isinstance` calls: `isinstance(v, bool | str)`
- Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:192:37: PLR1701 [*] Merge `isinstance` calls: `isinstance(v, bool | str)`
+ Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py:422:8: PLR1701 Merge `isinstance` calls: `isinstance(obj, list | str)`
- Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py:422:8: PLR1701 [*] Merge `isinstance` calls: `isinstance(obj, list | str)`
+ Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py:256:12: PLR1701 Merge `isinstance` calls
- Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py:256:12: PLR1701 [*] Merge `isinstance` calls
+ Packs/CofenseVision/Scripts/ConvertDictOfListToListOfDict/ConvertDictOfListToListOfDict.py:13:16: PLR1701 Merge `isinstance` calls: `isinstance(root[i], int | str)`
- Packs/CofenseVision/Scripts/ConvertDictOfListToListOfDict/ConvertDictOfListToListOfDict.py:13:16: PLR1701 [*] Merge `isinstance` calls: `isinstance(root[i], int | str)`
+ Packs/ExpanseV2/Scripts/ExpanseEvidenceDynamicSection/ExpanseEvidenceDynamicSection.py:15:8: PLR1701 Merge `isinstance` calls: `isinstance(v, float | int | str)`
- Packs/ExpanseV2/Scripts/ExpanseEvidenceDynamicSection/ExpanseEvidenceDynamicSection.py:15:8: PLR1701 [*] Merge `isinstance` calls: `isinstance(v, float | int | str)`
+ Packs/TOPdesk/Integrations/TOPdesk/TOPdesk.py:577:16: PLR1701 Merge `isinstance` calls: `isinstance(value, bool | str)`
- Packs/TOPdesk/Integrations/TOPdesk/TOPdesk.py:577:16: PLR1701 [*] Merge `isinstance` calls: `isinstance(value, bool | str)`

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR1701 18 0 0 0 18

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +0 -18 fixes in 1 projects; 49 projects unchanged)

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

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

+ Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py:196:16: PLR1701 Merge `isinstance` calls: `isinstance(val, dict | list)`
- Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py:196:16: PLR1701 [*] Merge `isinstance` calls: `isinstance(val, dict | list)`
+ Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector.py:33:12: PLR1701 Merge `isinstance` calls: `isinstance(obj, date | datetime)`
- Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector.py:33:12: PLR1701 [*] Merge `isinstance` calls: `isinstance(obj, date | datetime)`
+ Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:187:23: PLR1701 Merge `isinstance` calls: `isinstance(x, bool | str)`
- Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:187:23: PLR1701 [*] Merge `isinstance` calls: `isinstance(x, bool | str)`
+ Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:192:37: PLR1701 Merge `isinstance` calls: `isinstance(v, bool | str)`
- Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:192:37: PLR1701 [*] Merge `isinstance` calls: `isinstance(v, bool | str)`
+ Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py:422:8: PLR1701 Merge `isinstance` calls: `isinstance(obj, list | str)`
- Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py:422:8: PLR1701 [*] Merge `isinstance` calls: `isinstance(obj, list | str)`
+ Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py:256:12: PLR1701 Merge `isinstance` calls
- Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py:256:12: PLR1701 [*] Merge `isinstance` calls
+ Packs/CofenseVision/Scripts/ConvertDictOfListToListOfDict/ConvertDictOfListToListOfDict.py:13:16: PLR1701 Merge `isinstance` calls: `isinstance(root[i], int | str)`
- Packs/CofenseVision/Scripts/ConvertDictOfListToListOfDict/ConvertDictOfListToListOfDict.py:13:16: PLR1701 [*] Merge `isinstance` calls: `isinstance(root[i], int | str)`
+ Packs/ExpanseV2/Scripts/ExpanseEvidenceDynamicSection/ExpanseEvidenceDynamicSection.py:15:8: PLR1701 Merge `isinstance` calls: `isinstance(v, float | int | str)`
- Packs/ExpanseV2/Scripts/ExpanseEvidenceDynamicSection/ExpanseEvidenceDynamicSection.py:15:8: PLR1701 [*] Merge `isinstance` calls: `isinstance(v, float | int | str)`
+ Packs/TOPdesk/Integrations/TOPdesk/TOPdesk.py:577:16: PLR1701 Merge `isinstance` calls: `isinstance(value, bool | str)`
- Packs/TOPdesk/Integrations/TOPdesk/TOPdesk.py:577:16: PLR1701 [*] Merge `isinstance` calls: `isinstance(value, bool | str)`

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR1701 18 0 0 0 18

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.

PLR1701 fix is not safe (especially together with SIM114)
1 participant